From f3c195fc3bcd7f20ae84bf0f999dc89e2487eaee Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Wed, 8 Nov 2023 19:18:28 +0000 Subject: [PATCH] Regenerated Clients --- .../105e7a7a87a04621b33369b62339f24b.json | 8 + .../195dff0e9dfe44dba00e61432b66e5f6.json | 8 + .../33632f8e0bf5402db9bedafd199a6814.json | 8 + .../38e80340360549159c19c9ff6dc9cfc6.json | 8 + .../3f12b2c7ca524c8785a65a6d995b7b5e.json | 8 + .../56343c92710e45eeb86348ca8569afac.json | 8 + .../7703645707694ba7a6fb160f0a2d5226.json | 8 + .../8a0c3fca689b4f9f9c76f31fdffd8292.json | 8 + .../90b3fe986e1d41dd9ddfe8cb8ef45e82.json | 8 + .../9f549c59ba714e8bbd20a8b93b86673b.json | 8 + .../a4f37e7648034372ba677b920b4b555c.json | 8 + .../apprunner/internal/endpoints/endpoints.go | 9 + service/connect/api_op_SearchUsers.go | 5 + service/connect/endpoints_test.go | 20 - service/connect/validators.go | 39 + .../connectcases/api_op_CreateRelatedItem.go | 15 +- service/connectcases/deserializers.go | 47 + service/connectcases/serializers.go | 23 + service/connectcases/types/types.go | 22 + .../connectcases/types/types_exported_test.go | 18 + service/guardduty/api_op_CreateFilter.go | 4 + service/guardduty/api_op_ListMembers.go | 3 +- service/guardduty/deserializers.go | 829 +- service/guardduty/types/enums.go | 38 + service/guardduty/types/types.go | 169 + service/lambda/api_op_CreateFunction.go | 10 +- .../lambda/api_op_GetFunctionConfiguration.go | 6 +- service/lambda/api_op_Invoke.go | 7 +- service/lambda/api_op_InvokeAsync.go | 4 +- service/lambda/api_op_PublishVersion.go | 6 +- service/lambda/api_op_UpdateFunctionCode.go | 6 +- .../api_op_UpdateFunctionConfiguration.go | 10 +- service/lambda/types/enums.go | 2 + service/lambda/types/types.go | 10 +- service/lexmodelsv2/deserializers.go | 18 + service/lexmodelsv2/serializers.go | 10 + service/lexmodelsv2/types/types.go | 6 + service/omics/api_op_GetRun.go | 6 + service/omics/api_op_StartRun.go | 6 + service/omics/deserializers.go | 36 + .../rds/api_op_CreateCustomDBEngineVersion.go | 9 +- service/rds/endpoints_test.go | 20 - .../api_op_CreateWorkgroup.go | 4 + .../api_op_UpdateWorkgroup.go | 4 + service/redshiftserverless/deserializers.go | 13 + service/redshiftserverless/serializers.go | 10 + service/redshiftserverless/types/types.go | 4 + service/resiliencehub/deserializers.go | 192 + service/resiliencehub/types/enums.go | 44 + service/resiliencehub/types/types.go | 56 +- service/sqs/api_op_AddPermission.go | 4 +- service/sqs/api_op_CancelMessageMoveTask.go | 4 +- service/sqs/api_op_ChangeMessageVisibility.go | 4 +- .../api_op_ChangeMessageVisibilityBatch.go | 4 +- service/sqs/api_op_CreateQueue.go | 4 +- service/sqs/api_op_DeleteMessage.go | 4 +- service/sqs/api_op_DeleteMessageBatch.go | 4 +- service/sqs/api_op_DeleteQueue.go | 4 +- service/sqs/api_op_GetQueueAttributes.go | 4 +- service/sqs/api_op_GetQueueUrl.go | 4 +- .../sqs/api_op_ListDeadLetterSourceQueues.go | 4 +- service/sqs/api_op_ListMessageMoveTasks.go | 6 +- service/sqs/api_op_ListQueueTags.go | 4 +- service/sqs/api_op_ListQueues.go | 4 +- service/sqs/api_op_PurgeQueue.go | 4 +- service/sqs/api_op_ReceiveMessage.go | 4 +- service/sqs/api_op_RemovePermission.go | 4 +- service/sqs/api_op_SendMessage.go | 4 +- service/sqs/api_op_SendMessageBatch.go | 4 +- service/sqs/api_op_SetQueueAttributes.go | 4 +- service/sqs/api_op_StartMessageMoveTask.go | 6 +- service/sqs/api_op_TagQueue.go | 4 +- service/sqs/api_op_UntagQueue.go | 4 +- service/sqs/deserializers.go | 6670 ++++++++++------- service/sqs/endpoints.go | 4 +- service/sqs/serializers.go | 1136 ++- service/sqs/types/enums.go | 24 + service/sqs/types/errors.go | 323 +- service/sqs/types/types.go | 6 +- 79 files changed, 6544 insertions(+), 3543 deletions(-) create mode 100644 .changelog/105e7a7a87a04621b33369b62339f24b.json create mode 100644 .changelog/195dff0e9dfe44dba00e61432b66e5f6.json create mode 100644 .changelog/33632f8e0bf5402db9bedafd199a6814.json create mode 100644 .changelog/38e80340360549159c19c9ff6dc9cfc6.json create mode 100644 .changelog/3f12b2c7ca524c8785a65a6d995b7b5e.json create mode 100644 .changelog/56343c92710e45eeb86348ca8569afac.json create mode 100644 .changelog/7703645707694ba7a6fb160f0a2d5226.json create mode 100644 .changelog/8a0c3fca689b4f9f9c76f31fdffd8292.json create mode 100644 .changelog/90b3fe986e1d41dd9ddfe8cb8ef45e82.json create mode 100644 .changelog/9f549c59ba714e8bbd20a8b93b86673b.json create mode 100644 .changelog/a4f37e7648034372ba677b920b4b555c.json diff --git a/.changelog/105e7a7a87a04621b33369b62339f24b.json b/.changelog/105e7a7a87a04621b33369b62339f24b.json new file mode 100644 index 00000000000..7a4aa3af5a8 --- /dev/null +++ b/.changelog/105e7a7a87a04621b33369b62339f24b.json @@ -0,0 +1,8 @@ +{ + "id": "105e7a7a-87a0-4621-b333-69b62339f24b", + "type": "feature", + "description": "This change allows for 0 length access keys and secret keys for object storage locations. Users can now pass in empty string credentials.", + "modules": [ + "service/datasync" + ] +} \ No newline at end of file diff --git a/.changelog/195dff0e9dfe44dba00e61432b66e5f6.json b/.changelog/195dff0e9dfe44dba00e61432b66e5f6.json new file mode 100644 index 00000000000..38a5c724551 --- /dev/null +++ b/.changelog/195dff0e9dfe44dba00e61432b66e5f6.json @@ -0,0 +1,8 @@ +{ + "id": "195dff0e-9dfe-44db-a00e-61432b66e5f6", + "type": "feature", + "description": "Added a new parameter in the workgroup that helps you control your cost for compute resources. This feature provides a ceiling for RPUs that Amazon Redshift Serverless can scale up to. When automatic compute scaling is required, having a higher value for MaxRPU can enhance query throughput.", + "modules": [ + "service/redshiftserverless" + ] +} \ No newline at end of file diff --git a/.changelog/33632f8e0bf5402db9bedafd199a6814.json b/.changelog/33632f8e0bf5402db9bedafd199a6814.json new file mode 100644 index 00000000000..0e6d600c435 --- /dev/null +++ b/.changelog/33632f8e0bf5402db9bedafd199a6814.json @@ -0,0 +1,8 @@ +{ + "id": "33632f8e-0bf5-402d-b9be-dafd199a6814", + "type": "feature", + "description": "Add Node 20 (nodejs20.x) support to AWS Lambda.", + "modules": [ + "service/lambda" + ] +} \ No newline at end of file diff --git a/.changelog/38e80340360549159c19c9ff6dc9cfc6.json b/.changelog/38e80340360549159c19c9ff6dc9cfc6.json new file mode 100644 index 00000000000..eff32b1c20e --- /dev/null +++ b/.changelog/38e80340360549159c19c9ff6dc9cfc6.json @@ -0,0 +1,8 @@ +{ + "id": "38e80340-3605-4915-9c19-c9ff6dc9cfc6", + "type": "feature", + "description": "This release clarifies in our public documentation that InstanceId is a requirement for SearchUsers API requests.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/3f12b2c7ca524c8785a65a6d995b7b5e.json b/.changelog/3f12b2c7ca524c8785a65a6d995b7b5e.json new file mode 100644 index 00000000000..d8df7e34e94 --- /dev/null +++ b/.changelog/3f12b2c7ca524c8785a65a6d995b7b5e.json @@ -0,0 +1,8 @@ +{ + "id": "3f12b2c7-ca52-4c87-85a6-5a6d995b7b5e", + "type": "feature", + "description": "AWS Lex now supports selective log capture in conversation logs. When you enable this option within the conversation log settings, only the utterances that trigger intents and slots specified in session attributes will be logged.", + "modules": [ + "service/lexmodelsv2" + ] +} \ No newline at end of file diff --git a/.changelog/56343c92710e45eeb86348ca8569afac.json b/.changelog/56343c92710e45eeb86348ca8569afac.json new file mode 100644 index 00000000000..fcba25fd7fd --- /dev/null +++ b/.changelog/56343c92710e45eeb86348ca8569afac.json @@ -0,0 +1,8 @@ +{ + "id": "56343c92-710e-45ee-b863-48ca8569afac", + "type": "feature", + "description": "Added API support for new GuardDuty EKS Audit Log finding types.", + "modules": [ + "service/guardduty" + ] +} \ No newline at end of file diff --git a/.changelog/7703645707694ba7a6fb160f0a2d5226.json b/.changelog/7703645707694ba7a6fb160f0a2d5226.json new file mode 100644 index 00000000000..7b13f431817 --- /dev/null +++ b/.changelog/7703645707694ba7a6fb160f0a2d5226.json @@ -0,0 +1,8 @@ +{ + "id": "77036457-0769-4ba7-a6fb-160f0a2d5226", + "type": "feature", + "description": "Adding Run UUID and Run Output URI: GetRun and StartRun API response has two new fields \"uuid\" and \"runOutputUri\".", + "modules": [ + "service/omics" + ] +} \ No newline at end of file diff --git a/.changelog/8a0c3fca689b4f9f9c76f31fdffd8292.json b/.changelog/8a0c3fca689b4f9f9c76f31fdffd8292.json new file mode 100644 index 00000000000..26a346f18df --- /dev/null +++ b/.changelog/8a0c3fca689b4f9f9c76f31fdffd8292.json @@ -0,0 +1,8 @@ +{ + "id": "8a0c3fca-689b-4f9f-9c76-f31fdffd8292", + "type": "documentation", + "description": "This Amazon RDS release adds support for patching the OS of an RDS Custom for Oracle DB instance. You can now upgrade the database or operating system using the modify-db-instance command.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/90b3fe986e1d41dd9ddfe8cb8ef45e82.json b/.changelog/90b3fe986e1d41dd9ddfe8cb8ef45e82.json new file mode 100644 index 00000000000..98c0bdef170 --- /dev/null +++ b/.changelog/90b3fe986e1d41dd9ddfe8cb8ef45e82.json @@ -0,0 +1,8 @@ +{ + "id": "90b3fe98-6e1d-41dd-9ddf-e8cb8ef45e82", + "type": "feature", + "description": "AWS Resilience Hub enhances Resiliency Score, providing actionable recommendations to improve application resilience. Amazon Elastic Kubernetes Service (EKS) operational recommendations have been added to help improve the resilience posture of your applications.", + "modules": [ + "service/resiliencehub" + ] +} \ No newline at end of file diff --git a/.changelog/9f549c59ba714e8bbd20a8b93b86673b.json b/.changelog/9f549c59ba714e8bbd20a8b93b86673b.json new file mode 100644 index 00000000000..ae8ae5e1a4f --- /dev/null +++ b/.changelog/9f549c59ba714e8bbd20a8b93b86673b.json @@ -0,0 +1,8 @@ +{ + "id": "9f549c59-ba71-4e8b-bd20-a8b93b86673b", + "type": "feature", + "description": "This release adds the ability to add/view comment authors through CreateRelatedItem and SearchRelatedItems API. For more information see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html", + "modules": [ + "service/connectcases" + ] +} \ No newline at end of file diff --git a/.changelog/a4f37e7648034372ba677b920b4b555c.json b/.changelog/a4f37e7648034372ba677b920b4b555c.json new file mode 100644 index 00000000000..673daab89a0 --- /dev/null +++ b/.changelog/a4f37e7648034372ba677b920b4b555c.json @@ -0,0 +1,8 @@ +{ + "id": "a4f37e76-4803-4372-ba67-7b920b4b555c", + "type": "feature", + "description": "This release enables customers to call SQS using AWS JSON-1.0 protocol.", + "modules": [ + "service/sqs" + ] +} \ No newline at end of file diff --git a/service/apprunner/internal/endpoints/endpoints.go b/service/apprunner/internal/endpoints/endpoints.go index 672986029ba..51b0d938963 100644 --- a/service/apprunner/internal/endpoints/endpoints.go +++ b/service/apprunner/internal/endpoints/endpoints.go @@ -142,6 +142,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, @@ -154,6 +157,12 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ diff --git a/service/connect/api_op_SearchUsers.go b/service/connect/api_op_SearchUsers.go index b663e051f06..1017153cd23 100644 --- a/service/connect/api_op_SearchUsers.go +++ b/service/connect/api_op_SearchUsers.go @@ -38,6 +38,8 @@ type SearchUsersInput struct { // The identifier of the Amazon Connect instance. You can find the instance ID (https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html) // in the Amazon Resource Name (ARN) of the instance. InstanceID is a required // field. The "Required: No" below is incorrect. + // + // This member is required. InstanceId *string // The maximum number of results to return per page. @@ -127,6 +129,9 @@ func (c *Client) addOperationSearchUsersMiddlewares(stack *middleware.Stack, opt if err = addSearchUsersResolveEndpointMiddleware(stack, options); err != nil { return err } + if err = addOpSearchUsersValidationMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchUsers(options.Region), middleware.Before); err != nil { return err } diff --git a/service/connect/endpoints_test.go b/service/connect/endpoints_test.go index 0149a012e8c..8cce0dd03fd 100644 --- a/service/connect/endpoints_test.go +++ b/service/connect/endpoints_test.go @@ -1283,23 +1283,3 @@ func TestEndpointCase35(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } - -// Partition doesn't support DualStack -func TestEndpointCase36(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} diff --git a/service/connect/validators.go b/service/connect/validators.go index d086cfe0f87..21bffc73451 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -3050,6 +3050,26 @@ func (m *validateOpSearchSecurityProfiles) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpSearchUsers struct { +} + +func (*validateOpSearchUsers) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchUsersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchUsersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSearchVocabularies struct { } @@ -4818,6 +4838,10 @@ func addOpSearchSecurityProfilesValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpSearchSecurityProfiles{}, middleware.After) } +func addOpSearchUsersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchUsers{}, middleware.After) +} + func addOpSearchVocabulariesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchVocabularies{}, middleware.After) } @@ -9174,6 +9198,21 @@ func validateOpSearchSecurityProfilesInput(v *SearchSecurityProfilesInput) error } } +func validateOpSearchUsersInput(v *SearchUsersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchUsersInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSearchVocabulariesInput(v *SearchVocabulariesInput) error { if v == nil { return nil diff --git a/service/connectcases/api_op_CreateRelatedItem.go b/service/connectcases/api_op_CreateRelatedItem.go index 02aca0891e2..dc717052ec5 100644 --- a/service/connectcases/api_op_CreateRelatedItem.go +++ b/service/connectcases/api_op_CreateRelatedItem.go @@ -17,10 +17,14 @@ import ( ) // Creates a related item (comments, tasks, and contacts) and associates it with a -// case. A Related Item is a resource that is associated with a case. It may or may -// not have an external identifier linking it to an external resource (for example, -// a contactArn ). All Related Items have their own internal identifier, the -// relatedItemArn . Examples of related items include comments and contacts . +// case. +// - A Related Item is a resource that is associated with a case. It may or may +// not have an external identifier linking it to an external resource (for example, +// a contactArn ). All Related Items have their own internal identifier, the +// relatedItemArn . Examples of related items include comments and contacts . +// - If you provide a value for performedBy.userArn you must also have +// DescribeUser (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html) +// permission on the ARN of the user that you provide. func (c *Client) CreateRelatedItem(ctx context.Context, params *CreateRelatedItemInput, optFns ...func(*Options)) (*CreateRelatedItemOutput, error) { if params == nil { params = &CreateRelatedItemInput{} @@ -58,6 +62,9 @@ type CreateRelatedItemInput struct { // This member is required. Type types.RelatedItemType + // Represents the creator of the related item. + PerformedBy types.UserUnion + noSmithyDocumentSerde } diff --git a/service/connectcases/deserializers.go b/service/connectcases/deserializers.go index 95f06ebae5f..9962214b204 100644 --- a/service/connectcases/deserializers.go +++ b/service/connectcases/deserializers.go @@ -6986,6 +6986,11 @@ func awsRestjson1_deserializeDocumentSearchRelatedItemsResponseItem(v **types.Se return err } + case "performedBy": + if err := awsRestjson1_deserializeDocumentUserUnion(&sv.PerformedBy, value); err != nil { + return err + } + case "relatedItemId": if value != nil { jtv, ok := value.(string) @@ -7339,6 +7344,48 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc return nil } +func awsRestjson1_deserializeDocumentUserUnion(v *types.UserUnion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.UserUnion +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "userArn": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserArn to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.UserUnionMemberUserArn{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connectcases/serializers.go b/service/connectcases/serializers.go index 5376c39b0fb..37e5c4d2857 100644 --- a/service/connectcases/serializers.go +++ b/service/connectcases/serializers.go @@ -668,6 +668,13 @@ func awsRestjson1_serializeOpDocumentCreateRelatedItemInput(v *CreateRelatedItem } } + if v.PerformedBy != nil { + ok := object.Key("performedBy") + if err := awsRestjson1_serializeDocumentUserUnion(v.PerformedBy, ok); err != nil { + return err + } + } + if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) @@ -3343,3 +3350,19 @@ func awsRestjson1_serializeDocumentTags(v map[string]*string, value smithyjson.V } return nil } + +func awsRestjson1_serializeDocumentUserUnion(v types.UserUnion, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.UserUnionMemberUserArn: + av := object.Key("userArn") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} diff --git a/service/connectcases/types/types.go b/service/connectcases/types/types.go index 878a5128cc1..14743351f84 100644 --- a/service/connectcases/types/types.go +++ b/service/connectcases/types/types.go @@ -732,6 +732,9 @@ type SearchRelatedItemsResponseItem struct { // This member is required. Type RelatedItemType + // Represents the creator of the related item. + PerformedBy UserUnion + // A map of of key-value pairs that represent tags on a resource. Tags are used to // organize, track, or control access for this resource. Tags map[string]*string @@ -799,6 +802,24 @@ type TemplateSummary struct { noSmithyDocumentSerde } +// Represents the identity of the person who performed the action. +// +// The following types satisfy this interface: +// +// UserUnionMemberUserArn +type UserUnion interface { + isUserUnion() +} + +// Represents the Amazon Connect ARN of the user. +type UserUnionMemberUserArn struct { + Value string + + noSmithyDocumentSerde +} + +func (*UserUnionMemberUserArn) isUserUnion() {} + type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, @@ -818,3 +839,4 @@ func (*UnknownUnionMember) isRelatedItemContent() {} func (*UnknownUnionMember) isRelatedItemInputContent() {} func (*UnknownUnionMember) isRelatedItemTypeFilter() {} func (*UnknownUnionMember) isSection() {} +func (*UnknownUnionMember) isUserUnion() {} diff --git a/service/connectcases/types/types_exported_test.go b/service/connectcases/types/types_exported_test.go index 13cc167a0d5..3ef449767fd 100644 --- a/service/connectcases/types/types_exported_test.go +++ b/service/connectcases/types/types_exported_test.go @@ -200,3 +200,21 @@ func ExampleSection_outputUsage() { } var _ *types.FieldGroup + +func ExampleUserUnion_outputUsage() { + var union types.UserUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.UserUnionMemberUserArn: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string diff --git a/service/guardduty/api_op_CreateFilter.go b/service/guardduty/api_op_CreateFilter.go index 858e14c0bde..e266bbe58a8 100644 --- a/service/guardduty/api_op_CreateFilter.go +++ b/service/guardduty/api_op_CreateFilter.go @@ -95,6 +95,7 @@ type CreateFilterInput struct { // - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg // - service.action.awsApiCallAction.serviceName // - service.action.dnsRequestAction.domain + // - service.action.dnsRequestAction.domainWithSuffix // - service.action.networkConnectionAction.blocked // - service.action.networkConnectionAction.connectionDirection // - service.action.networkConnectionAction.localPortDetails.port @@ -107,7 +108,10 @@ type CreateFilterInput struct { // - service.action.networkConnectionAction.remotePortDetails.port // - service.action.awsApiCallAction.remoteAccountDetails.affiliated // - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV4 + // - service.action.kubernetesApiCallAction.namespace + // - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asn // - service.action.kubernetesApiCallAction.requestUri + // - service.action.kubernetesApiCallAction.statusCode // - service.action.networkConnectionAction.localIpDetails.ipAddressV4 // - service.action.networkConnectionAction.protocol // - service.action.awsApiCallAction.serviceName diff --git a/service/guardduty/api_op_ListMembers.go b/service/guardduty/api_op_ListMembers.go index 2942d12281c..2cae71a0478 100644 --- a/service/guardduty/api_op_ListMembers.go +++ b/service/guardduty/api_op_ListMembers.go @@ -62,7 +62,8 @@ type ListMembersInput struct { type ListMembersOutput struct { - // A list of members. + // A list of members. The values for email and invitedAt are available only if the + // member accounts are added by invitation. Members []types.Member // The pagination parameter to be used on the next list operation to retrieve more diff --git a/service/guardduty/deserializers.go b/service/guardduty/deserializers.go index f200b06d323..9a90a7ae75a 100644 --- a/service/guardduty/deserializers.go +++ b/service/guardduty/deserializers.go @@ -9661,6 +9661,21 @@ func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) return err } + case "kubernetesPermissionCheckedDetails": + if err := awsRestjson1_deserializeDocumentKubernetesPermissionCheckedDetails(&sv.KubernetesPermissionCheckedDetails, value); err != nil { + return err + } + + case "kubernetesRoleBindingDetails": + if err := awsRestjson1_deserializeDocumentKubernetesRoleBindingDetails(&sv.KubernetesRoleBindingDetails, value); err != nil { + return err + } + + case "kubernetesRoleDetails": + if err := awsRestjson1_deserializeDocumentKubernetesRoleDetails(&sv.KubernetesRoleDetails, value); err != nil { + return err + } + case "networkConnectionAction": if err := awsRestjson1_deserializeDocumentNetworkConnectionAction(&sv.NetworkConnectionAction, value); err != nil { return err @@ -9920,6 +9935,274 @@ func awsRestjson1_deserializeDocumentAffectedResources(v *map[string]string, val return nil } +func awsRestjson1_deserializeDocumentAnomaly(v **types.Anomaly, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Anomaly + if *v == nil { + sv = &types.Anomaly{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "profiles": + if err := awsRestjson1_deserializeDocumentAnomalyProfiles(&sv.Profiles, value); err != nil { + return err + } + + case "unusual": + if err := awsRestjson1_deserializeDocumentAnomalyUnusual(&sv.Unusual, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnomalyObject(v **types.AnomalyObject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AnomalyObject + if *v == nil { + sv = &types.AnomalyObject{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "observations": + if err := awsRestjson1_deserializeDocumentObservations(&sv.Observations, value); err != nil { + return err + } + + case "profileSubtype": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileSubtype to be of type string, got %T instead", value) + } + sv.ProfileSubtype = types.ProfileSubtype(jtv) + } + + case "profileType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProfileType to be of type string, got %T instead", value) + } + sv.ProfileType = types.ProfileType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnomalyProfileFeatureObjects(v *[]types.AnomalyObject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AnomalyObject + if *v == nil { + cv = []types.AnomalyObject{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AnomalyObject + destAddr := &col + if err := awsRestjson1_deserializeDocumentAnomalyObject(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAnomalyProfileFeatures(v *map[string][]types.AnomalyObject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string][]types.AnomalyObject + if *v == nil { + mv = map[string][]types.AnomalyObject{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal []types.AnomalyObject + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentAnomalyProfileFeatureObjects(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAnomalyProfiles(v *map[string]map[string][]types.AnomalyObject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]map[string][]types.AnomalyObject + if *v == nil { + mv = map[string]map[string][]types.AnomalyObject{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal map[string][]types.AnomalyObject + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentAnomalyProfileFeatures(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAnomalyUnusual(v **types.AnomalyUnusual, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AnomalyUnusual + if *v == nil { + sv = &types.AnomalyUnusual{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "behavior": + if err := awsRestjson1_deserializeDocumentBehavior(&sv.Behavior, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnomalyUnusualBehaviorFeature(v *map[string]types.AnomalyObject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.AnomalyObject + if *v == nil { + mv = map[string]types.AnomalyObject{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.AnomalyObject + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentAnomalyObject(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentAwsApiCallAction(v **types.AwsApiCallAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10065,6 +10348,40 @@ func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestExc return nil } +func awsRestjson1_deserializeDocumentBehavior(v *map[string]map[string]types.AnomalyObject, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]map[string]types.AnomalyObject + if *v == nil { + mv = map[string]map[string]types.AnomalyObject{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal map[string]types.AnomalyObject + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentAnomalyUnusualBehaviorFeature(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentBlockPublicAccess(v **types.BlockPublicAccess, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11488,6 +11805,42 @@ func awsRestjson1_deserializeDocumentDestinations(v *[]types.Destination, value return nil } +func awsRestjson1_deserializeDocumentDetection(v **types.Detection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Detection + if *v == nil { + sv = &types.Detection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "anomaly": + if err := awsRestjson1_deserializeDocumentAnomaly(&sv.Anomaly, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDetectorAdditionalConfigurationResult(v **types.DetectorAdditionalConfigurationResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13359,6 +13712,51 @@ func awsRestjson1_deserializeDocumentIamInstanceProfile(v **types.IamInstancePro return nil } +func awsRestjson1_deserializeDocumentImpersonatedUser(v **types.ImpersonatedUser, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ImpersonatedUser + if *v == nil { + sv = &types.ImpersonatedUser{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "groups": + if err := awsRestjson1_deserializeDocumentGroups(&sv.Groups, value); err != nil { + return err + } + + case "username": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Username = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInstanceDetails(v **types.InstanceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13735,6 +14133,15 @@ func awsRestjson1_deserializeDocumentKubernetesApiCallAction(v **types.Kubernete for key, value := range shape { switch key { + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + case "parameters": if value != nil { jtv, ok := value.(string) @@ -13758,6 +14165,24 @@ func awsRestjson1_deserializeDocumentKubernetesApiCallAction(v **types.Kubernete sv.RequestUri = ptr.String(jtv) } + case "resource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Resource = ptr.String(jtv) + } + + case "resourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + case "sourceIps": if err := awsRestjson1_deserializeDocumentSourceIps(&sv.SourceIps, value); err != nil { return err @@ -13776,6 +14201,15 @@ func awsRestjson1_deserializeDocumentKubernetesApiCallAction(v **types.Kubernete sv.StatusCode = ptr.Int32(int32(i64)) } + case "subresource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Subresource = ptr.String(jtv) + } + case "userAgent": if value != nil { jtv, ok := value.(string) @@ -13785,13 +14219,125 @@ func awsRestjson1_deserializeDocumentKubernetesApiCallAction(v **types.Kubernete sv.UserAgent = ptr.String(jtv) } - case "verb": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Verb = ptr.String(jtv) + case "verb": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Verb = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKubernetesAuditLogsConfigurationResult(v **types.KubernetesAuditLogsConfigurationResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KubernetesAuditLogsConfigurationResult + if *v == nil { + sv = &types.KubernetesAuditLogsConfigurationResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) + } + sv.Status = types.DataSourceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKubernetesConfigurationResult(v **types.KubernetesConfigurationResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KubernetesConfigurationResult + if *v == nil { + sv = &types.KubernetesConfigurationResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "auditLogs": + if err := awsRestjson1_deserializeDocumentKubernetesAuditLogsConfigurationResult(&sv.AuditLogs, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKubernetesDataSourceFreeTrial(v **types.KubernetesDataSourceFreeTrial, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KubernetesDataSourceFreeTrial + if *v == nil { + sv = &types.KubernetesDataSourceFreeTrial{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "auditLogs": + if err := awsRestjson1_deserializeDocumentDataSourceFreeTrial(&sv.AuditLogs, value); err != nil { + return err } default: @@ -13803,7 +14349,7 @@ func awsRestjson1_deserializeDocumentKubernetesApiCallAction(v **types.Kubernete return nil } -func awsRestjson1_deserializeDocumentKubernetesAuditLogsConfigurationResult(v **types.KubernetesAuditLogsConfigurationResult, value interface{}) error { +func awsRestjson1_deserializeDocumentKubernetesDetails(v **types.KubernetesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13816,22 +14362,23 @@ func awsRestjson1_deserializeDocumentKubernetesAuditLogsConfigurationResult(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KubernetesAuditLogsConfigurationResult + var sv *types.KubernetesDetails if *v == nil { - sv = &types.KubernetesAuditLogsConfigurationResult{} + sv = &types.KubernetesDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DataSourceStatus to be of type string, got %T instead", value) - } - sv.Status = types.DataSourceStatus(jtv) + case "kubernetesUserDetails": + if err := awsRestjson1_deserializeDocumentKubernetesUserDetails(&sv.KubernetesUserDetails, value); err != nil { + return err + } + + case "kubernetesWorkloadDetails": + if err := awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(&sv.KubernetesWorkloadDetails, value); err != nil { + return err } default: @@ -13843,7 +14390,7 @@ func awsRestjson1_deserializeDocumentKubernetesAuditLogsConfigurationResult(v ** return nil } -func awsRestjson1_deserializeDocumentKubernetesConfigurationResult(v **types.KubernetesConfigurationResult, value interface{}) error { +func awsRestjson1_deserializeDocumentKubernetesPermissionCheckedDetails(v **types.KubernetesPermissionCheckedDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13856,18 +14403,49 @@ func awsRestjson1_deserializeDocumentKubernetesConfigurationResult(v **types.Kub return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KubernetesConfigurationResult + var sv *types.KubernetesPermissionCheckedDetails if *v == nil { - sv = &types.KubernetesConfigurationResult{} + sv = &types.KubernetesPermissionCheckedDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "auditLogs": - if err := awsRestjson1_deserializeDocumentKubernetesAuditLogsConfigurationResult(&sv.AuditLogs, value); err != nil { - return err + case "allowed": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Allowed = ptr.Bool(jtv) + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "resource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Resource = ptr.String(jtv) + } + + case "verb": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Verb = ptr.String(jtv) } default: @@ -13879,7 +14457,7 @@ func awsRestjson1_deserializeDocumentKubernetesConfigurationResult(v **types.Kub return nil } -func awsRestjson1_deserializeDocumentKubernetesDataSourceFreeTrial(v **types.KubernetesDataSourceFreeTrial, value interface{}) error { +func awsRestjson1_deserializeDocumentKubernetesRoleBindingDetails(v **types.KubernetesRoleBindingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13892,18 +14470,58 @@ func awsRestjson1_deserializeDocumentKubernetesDataSourceFreeTrial(v **types.Kub return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KubernetesDataSourceFreeTrial + var sv *types.KubernetesRoleBindingDetails if *v == nil { - sv = &types.KubernetesDataSourceFreeTrial{} + sv = &types.KubernetesRoleBindingDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "auditLogs": - if err := awsRestjson1_deserializeDocumentDataSourceFreeTrial(&sv.AuditLogs, value); err != nil { - return err + case "kind": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Kind = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "roleRefKind": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RoleRefKind = ptr.String(jtv) + } + + case "roleRefName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RoleRefName = ptr.String(jtv) + } + + case "uid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Uid = ptr.String(jtv) } default: @@ -13915,7 +14533,7 @@ func awsRestjson1_deserializeDocumentKubernetesDataSourceFreeTrial(v **types.Kub return nil } -func awsRestjson1_deserializeDocumentKubernetesDetails(v **types.KubernetesDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentKubernetesRoleDetails(v **types.KubernetesRoleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13928,23 +14546,40 @@ func awsRestjson1_deserializeDocumentKubernetesDetails(v **types.KubernetesDetai return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.KubernetesDetails + var sv *types.KubernetesRoleDetails if *v == nil { - sv = &types.KubernetesDetails{} + sv = &types.KubernetesRoleDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "kubernetesUserDetails": - if err := awsRestjson1_deserializeDocumentKubernetesUserDetails(&sv.KubernetesUserDetails, value); err != nil { - return err + case "kind": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Kind = ptr.String(jtv) } - case "kubernetesWorkloadDetails": - if err := awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(&sv.KubernetesWorkloadDetails, value); err != nil { - return err + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "uid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Uid = ptr.String(jtv) } default: @@ -13983,6 +14618,11 @@ func awsRestjson1_deserializeDocumentKubernetesUserDetails(v **types.KubernetesU return err } + case "impersonatedUser": + if err := awsRestjson1_deserializeDocumentImpersonatedUser(&sv.ImpersonatedUser, value); err != nil { + return err + } + case "sessionName": if err := awsRestjson1_deserializeDocumentSessionNameList(&sv.SessionName, value); err != nil { return err @@ -14042,6 +14682,15 @@ func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.Kuberne return err } + case "hostIPC": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.HostIPC = ptr.Bool(jtv) + } + case "hostNetwork": if value != nil { jtv, ok := value.(bool) @@ -14051,6 +14700,15 @@ func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.Kuberne sv.HostNetwork = ptr.Bool(jtv) } + case "hostPID": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.HostPID = ptr.Bool(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -14069,6 +14727,15 @@ func awsRestjson1_deserializeDocumentKubernetesWorkloadDetails(v **types.Kuberne sv.Namespace = ptr.String(jtv) } + case "serviceAccountName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceAccountName = ptr.String(jtv) + } + case "type": if value != nil { jtv, ok := value.(string) @@ -15518,6 +16185,78 @@ func awsRestjson1_deserializeDocumentNotEquals(v *[]string, value interface{}) e return nil } +func awsRestjson1_deserializeDocumentObservations(v **types.Observations, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Observations + if *v == nil { + sv = &types.Observations{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "text": + if err := awsRestjson1_deserializeDocumentObservationTexts(&sv.Text, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentObservationTexts(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentOrganization(v **types.Organization, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18278,6 +19017,15 @@ func awsRestjson1_deserializeDocumentSecurityContext(v **types.SecurityContext, for key, value := range shape { switch key { + case "allowPrivilegeEscalation": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AllowPrivilegeEscalation = ptr.Bool(jtv) + } + case "privileged": if value != nil { jtv, ok := value.(bool) @@ -18433,6 +19181,11 @@ func awsRestjson1_deserializeDocumentService(v **types.Service, value interface{ sv.Count = ptr.Int32(int32(i64)) } + case "detection": + if err := awsRestjson1_deserializeDocumentDetection(&sv.Detection, value); err != nil { + return err + } + case "detectorId": if value != nil { jtv, ok := value.(string) diff --git a/service/guardduty/types/enums.go b/service/guardduty/types/enums.go index c649ef10820..f2697464eb1 100644 --- a/service/guardduty/types/enums.go +++ b/service/guardduty/types/enums.go @@ -606,6 +606,44 @@ func (OrgFeatureStatus) Values() []OrgFeatureStatus { } } +type ProfileSubtype string + +// Enum values for ProfileSubtype +const ( + ProfileSubtypeFrequent ProfileSubtype = "FREQUENT" + ProfileSubtypeInfrequent ProfileSubtype = "INFREQUENT" + ProfileSubtypeUnseen ProfileSubtype = "UNSEEN" + ProfileSubtypeRare ProfileSubtype = "RARE" +) + +// Values returns all known values for ProfileSubtype. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ProfileSubtype) Values() []ProfileSubtype { + return []ProfileSubtype{ + "FREQUENT", + "INFREQUENT", + "UNSEEN", + "RARE", + } +} + +type ProfileType string + +// Enum values for ProfileType +const ( + ProfileTypeFrequency ProfileType = "FREQUENCY" +) + +// Values returns all known values for ProfileType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (ProfileType) Values() []ProfileType { + return []ProfileType{ + "FREQUENCY", + } +} + type PublishingStatus string // Enum values for PublishingStatus diff --git a/service/guardduty/types/types.go b/service/guardduty/types/types.go index a08e683b2c1..a90068cd138 100644 --- a/service/guardduty/types/types.go +++ b/service/guardduty/types/types.go @@ -96,6 +96,17 @@ type Action struct { // Information about the Kubernetes API call action described in this finding. KubernetesApiCallAction *KubernetesApiCallAction + // Information whether the user has the permission to use a specific Kubernetes + // API. + KubernetesPermissionCheckedDetails *KubernetesPermissionCheckedDetails + + // Information about the role binding that grants the permission defined in a + // Kubernetes role. + KubernetesRoleBindingDetails *KubernetesRoleBindingDetails + + // Information about the Kubernetes role name and role type. + KubernetesRoleDetails *KubernetesRoleDetails + // Information about the NETWORK_CONNECTION action described in this finding. NetworkConnectionAction *NetworkConnectionAction @@ -152,6 +163,43 @@ type Administrator struct { noSmithyDocumentSerde } +// Contains information about the anomalies. +type Anomaly struct { + + // Information about the types of profiles. + Profiles map[string]map[string][]AnomalyObject + + // Information about the behavior of the anomalies. + Unusual *AnomalyUnusual + + noSmithyDocumentSerde +} + +// Contains information about the unusual anomalies. +type AnomalyObject struct { + + // The recorded value. + Observations *Observations + + // The frequency of the anomaly. + ProfileSubtype ProfileSubtype + + // The type of behavior of the profile. + ProfileType ProfileType + + noSmithyDocumentSerde +} + +// Contains information about the behavior of the anomaly that is new to GuardDuty. +type AnomalyUnusual struct { + + // The behavior of the anomalous activity that caused GuardDuty to generate the + // finding. + Behavior map[string]map[string]AnomalyObject + + noSmithyDocumentSerde +} + // Contains information about the API action. type AwsApiCallAction struct { @@ -634,6 +682,16 @@ type DestinationProperties struct { noSmithyDocumentSerde } +// Contains information about the detected behavior. +type Detection struct { + + // The details about the anomalous activity that caused GuardDuty to generate the + // finding. + Anomaly *Anomaly + + noSmithyDocumentSerde +} + // Information about the additional configuration for a feature in your GuardDuty // account. type DetectorAdditionalConfiguration struct { @@ -1097,6 +1155,18 @@ type IamInstanceProfile struct { noSmithyDocumentSerde } +// Contains information about the impersonated user. +type ImpersonatedUser struct { + + // The group to which the user name belongs. + Groups []string + + // Information about the username that was being impersonated. + Username *string + + noSmithyDocumentSerde +} + // Contains information about the details of an instance. type InstanceDetails struct { @@ -1165,6 +1235,9 @@ type Invitation struct { // Information about the Kubernetes API call action described in this finding. type KubernetesApiCallAction struct { + // The name of the namespace where the Kubernetes API call action takes place. + Namespace *string + // Parameters related to the Kubernetes API call action. Parameters *string @@ -1174,6 +1247,12 @@ type KubernetesApiCallAction struct { // The Kubernetes API request URI. RequestUri *string + // The resource component in the Kubernetes API call action. + Resource *string + + // The name of the resource in the Kubernetes API call action. + ResourceName *string + // The IP of the Kubernetes API caller and the IPs of any proxies or load // balancers between the caller and the API endpoint. SourceIps []string @@ -1181,6 +1260,9 @@ type KubernetesApiCallAction struct { // The resulting HTTP response code of the Kubernetes API call action. StatusCode *int32 + // The name of the sub-resource in the Kubernetes API call action. + Subresource *string + // The user agent of the caller of the Kubernetes API. UserAgent *string @@ -1258,12 +1340,74 @@ type KubernetesDetails struct { noSmithyDocumentSerde } +// Information about the Kubernetes API for which you check if you have permission +// to call. +type KubernetesPermissionCheckedDetails struct { + + // Information whether the user has the permission to call the Kubernetes API. + Allowed *bool + + // The namespace where the Kubernetes API action will take place. + Namespace *string + + // The Kubernetes resource with which your Kubernetes API call will interact. + Resource *string + + // The verb component of the Kubernetes API call. For example, when you check + // whether or not you have the permission to call the CreatePod API, the verb + // component will be Create . + Verb *string + + noSmithyDocumentSerde +} + +// Contains information about the role binding that grants the permission defined +// in a Kubernetes role. +type KubernetesRoleBindingDetails struct { + + // The kind of the role. For role binding, this value will be RoleBinding . + Kind *string + + // The name of the RoleBinding . + Name *string + + // The type of the role being referenced. This could be either Role or ClusterRole . + RoleRefKind *string + + // The name of the role being referenced. This must match the name of the Role or + // ClusterRole that you want to bind to. + RoleRefName *string + + // The unique identifier of the role binding. + Uid *string + + noSmithyDocumentSerde +} + +// Information about the Kubernetes role name and role type. +type KubernetesRoleDetails struct { + + // The kind of role. For this API, the value of kind will be Role . + Kind *string + + // The name of the Kubernetes role. + Name *string + + // The unique identifier of the Kubernetes role name. + Uid *string + + noSmithyDocumentSerde +} + // Details about the Kubernetes user involved in a Kubernetes finding. type KubernetesUserDetails struct { // The groups that include the user who called the Kubernetes API. Groups []string + // Information about the impersonated user. + ImpersonatedUser *ImpersonatedUser + // Entity that assumes the IAM role when Kubernetes RBAC permissions are assigned // to that role. SessionName []string @@ -1283,15 +1427,24 @@ type KubernetesWorkloadDetails struct { // Containers running as part of the Kubernetes workload. Containers []Container + // Whether the host IPC flag is enabled for the pods in the workload. + HostIPC *bool + // Whether the hostNetwork flag is enabled for the pods included in the workload. HostNetwork *bool + // Whether the host PID flag is enabled for the pods in the workload. + HostPID *bool + // Kubernetes workload name. Name *string // Kubernetes namespace that the workload is part of. Namespace *string + // The service account name that is associated with a Kubernetes workload. + ServiceAccountName *string + // Kubernetes workload type (e.g. Pod, Deployment, etc.). Type *string @@ -1654,6 +1807,15 @@ type NetworkInterface struct { noSmithyDocumentSerde } +// Contains information about the observed behavior. +type Observations struct { + + // The text that was unusual. + Text []string + + noSmithyDocumentSerde +} + // Contains information about the ISP organization of the remote IP address. type Organization struct { @@ -2592,6 +2754,10 @@ type ScanThreatName struct { // Container security context. type SecurityContext struct { + // Whether or not a container or a Kubernetes pod is allowed to gain more + // privileges than its parent process. + AllowPrivilegeEscalation *bool + // Whether the container is privileged. Privileged *bool @@ -2625,6 +2791,9 @@ type Service struct { // The total count of the occurrences of this finding type. Count *int32 + // Contains information about the detected unusual behavior. + Detection *Detection + // The detector ID for the GuardDuty service. DetectorId *string diff --git a/service/lambda/api_op_CreateFunction.go b/service/lambda/api_op_CreateFunction.go index c5e45f51483..0a9505d37f9 100644 --- a/service/lambda/api_op_CreateFunction.go +++ b/service/lambda/api_op_CreateFunction.go @@ -122,7 +122,9 @@ type CreateFunctionInput struct { Environment *types.Environment // The size of the function's /tmp directory in MB. The default value is 512, but - // can be any whole number between 512 and 10,240 MB. + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system. @@ -226,8 +228,10 @@ type CreateFunctionOutput struct { // . Omitted from CloudTrail logs. Environment *types.EnvironmentResponse - // The size of the function’s /tmp directory in MB. The default value is 512, but - // it can be any whole number between 512 and 10,240 MB. + // The size of the function's /tmp directory in MB. The default value is 512, but + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) diff --git a/service/lambda/api_op_GetFunctionConfiguration.go b/service/lambda/api_op_GetFunctionConfiguration.go index 27fdee3cf3e..bf8584950ab 100644 --- a/service/lambda/api_op_GetFunctionConfiguration.go +++ b/service/lambda/api_op_GetFunctionConfiguration.go @@ -83,8 +83,10 @@ type GetFunctionConfigurationOutput struct { // . Omitted from CloudTrail logs. Environment *types.EnvironmentResponse - // The size of the function’s /tmp directory in MB. The default value is 512, but - // it can be any whole number between 512 and 10,240 MB. + // The size of the function's /tmp directory in MB. The default value is 512, but + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) diff --git a/service/lambda/api_op_Invoke.go b/service/lambda/api_op_Invoke.go index 6e51cf030a0..c066418da6b 100644 --- a/service/lambda/api_op_Invoke.go +++ b/service/lambda/api_op_Invoke.go @@ -17,8 +17,11 @@ import ( ) // Invokes a Lambda function. You can invoke a function synchronously (and wait -// for the response), or asynchronously. To invoke a function asynchronously, set -// InvocationType to Event . For synchronous invocation (https://docs.aws.amazon.com/lambda/latest/dg/invocation-sync.html) +// for the response), or asynchronously. By default, Lambda invokes your function +// synchronously (i.e. the InvocationType is RequestResponse ). To invoke a +// function asynchronously, set InvocationType to Event . Lambda passes the +// ClientContext object to your function for synchronous invocations only. For +// synchronous invocation (https://docs.aws.amazon.com/lambda/latest/dg/invocation-sync.html) // , details about the function response, including errors, are included in the // response body and headers. For either invocation type, you can find more // information in the execution log (https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html) diff --git a/service/lambda/api_op_InvokeAsync.go b/service/lambda/api_op_InvokeAsync.go index 58fda5a682e..21cd5ce438e 100644 --- a/service/lambda/api_op_InvokeAsync.go +++ b/service/lambda/api_op_InvokeAsync.go @@ -17,7 +17,9 @@ import ( ) // For asynchronous function invocation, use Invoke . Invokes a function -// asynchronously. +// asynchronously. If you do use the InvokeAsync action, note that it doesn't +// support the use of X-Ray active tracing. Trace ID is not propagated to the +// function, even if X-Ray active tracing is turned on. // // Deprecated: This operation has been deprecated. func (c *Client) InvokeAsync(ctx context.Context, params *InvokeAsyncInput, optFns ...func(*Options)) (*InvokeAsyncOutput, error) { diff --git a/service/lambda/api_op_PublishVersion.go b/service/lambda/api_op_PublishVersion.go index fe786a4cc42..f3123bdaf1f 100644 --- a/service/lambda/api_op_PublishVersion.go +++ b/service/lambda/api_op_PublishVersion.go @@ -93,8 +93,10 @@ type PublishVersionOutput struct { // . Omitted from CloudTrail logs. Environment *types.EnvironmentResponse - // The size of the function’s /tmp directory in MB. The default value is 512, but - // it can be any whole number between 512 and 10,240 MB. + // The size of the function's /tmp directory in MB. The default value is 512, but + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) diff --git a/service/lambda/api_op_UpdateFunctionCode.go b/service/lambda/api_op_UpdateFunctionCode.go index 8101e0dbca2..14eab60d7f9 100644 --- a/service/lambda/api_op_UpdateFunctionCode.go +++ b/service/lambda/api_op_UpdateFunctionCode.go @@ -124,8 +124,10 @@ type UpdateFunctionCodeOutput struct { // . Omitted from CloudTrail logs. Environment *types.EnvironmentResponse - // The size of the function’s /tmp directory in MB. The default value is 512, but - // it can be any whole number between 512 and 10,240 MB. + // The size of the function's /tmp directory in MB. The default value is 512, but + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) diff --git a/service/lambda/api_op_UpdateFunctionConfiguration.go b/service/lambda/api_op_UpdateFunctionConfiguration.go index e7389a05537..cea835859d7 100644 --- a/service/lambda/api_op_UpdateFunctionConfiguration.go +++ b/service/lambda/api_op_UpdateFunctionConfiguration.go @@ -69,7 +69,9 @@ type UpdateFunctionConfigurationInput struct { Environment *types.Environment // The size of the function's /tmp directory in MB. The default value is 512, but - // can be any whole number between 512 and 10,240 MB. + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system. @@ -170,8 +172,10 @@ type UpdateFunctionConfigurationOutput struct { // . Omitted from CloudTrail logs. Environment *types.EnvironmentResponse - // The size of the function’s /tmp directory in MB. The default value is 512, but - // it can be any whole number between 512 and 10,240 MB. + // The size of the function's /tmp directory in MB. The default value is 512, but + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) diff --git a/service/lambda/types/enums.go b/service/lambda/types/enums.go index 3e94fbc14fe..7ab39cbfa8d 100644 --- a/service/lambda/types/enums.go +++ b/service/lambda/types/enums.go @@ -368,6 +368,7 @@ const ( RuntimeJava17 Runtime = "java17" RuntimeRuby32 Runtime = "ruby3.2" RuntimePython311 Runtime = "python3.11" + RuntimeNodejs20x Runtime = "nodejs20.x" ) // Values returns all known values for Runtime. Note that this can be expanded in @@ -407,6 +408,7 @@ func (Runtime) Values() []Runtime { "java17", "ruby3.2", "python3.11", + "nodejs20.x", } } diff --git a/service/lambda/types/types.go b/service/lambda/types/types.go index 16ebedc6698..166e7f6c6aa 100644 --- a/service/lambda/types/types.go +++ b/service/lambda/types/types.go @@ -287,7 +287,9 @@ type EnvironmentResponse struct { } // The size of the function's /tmp directory in MB. The default value is 512, but -// it can be any whole number between 512 and 10,240 MB. +// can be any whole number between 512 and 10,240 MB. For more information, see +// Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) +// . type EphemeralStorage struct { // The size of the function's /tmp directory. @@ -537,8 +539,10 @@ type FunctionConfiguration struct { // . Omitted from CloudTrail logs. Environment *EnvironmentResponse - // The size of the function’s /tmp directory in MB. The default value is 512, but - // it can be any whole number between 512 and 10,240 MB. + // The size of the function's /tmp directory in MB. The default value is 512, but + // can be any whole number between 512 and 10,240 MB. For more information, see + // Configuring ephemeral storage (console) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage) + // . EphemeralStorage *EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) diff --git a/service/lexmodelsv2/deserializers.go b/service/lexmodelsv2/deserializers.go index c000edf96b5..9d4e65ef1f2 100644 --- a/service/lexmodelsv2/deserializers.go +++ b/service/lexmodelsv2/deserializers.go @@ -21155,6 +21155,15 @@ func awsRestjson1_deserializeDocumentAudioLogSetting(v **types.AudioLogSetting, sv.Enabled = jtv } + case "selectiveLoggingEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + } + sv.SelectiveLoggingEnabled = ptr.Bool(jtv) + } + default: _, _ = key, value @@ -31697,6 +31706,15 @@ func awsRestjson1_deserializeDocumentTextLogSetting(v **types.TextLogSetting, va sv.Enabled = jtv } + case "selectiveLoggingEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) + } + sv.SelectiveLoggingEnabled = ptr.Bool(jtv) + } + default: _, _ = key, value diff --git a/service/lexmodelsv2/serializers.go b/service/lexmodelsv2/serializers.go index bf49b0049b2..8c316a50be6 100644 --- a/service/lexmodelsv2/serializers.go +++ b/service/lexmodelsv2/serializers.go @@ -9900,6 +9900,11 @@ func awsRestjson1_serializeDocumentAudioLogSetting(v *types.AudioLogSetting, val ok.Boolean(v.Enabled) } + if v.SelectiveLoggingEnabled != nil { + ok := object.Key("selectiveLoggingEnabled") + ok.Boolean(*v.SelectiveLoggingEnabled) + } + return nil } @@ -13137,6 +13142,11 @@ func awsRestjson1_serializeDocumentTextLogSetting(v *types.TextLogSetting, value ok.Boolean(v.Enabled) } + if v.SelectiveLoggingEnabled != nil { + ok := object.Key("selectiveLoggingEnabled") + ok.Boolean(*v.SelectiveLoggingEnabled) + } + return nil } diff --git a/service/lexmodelsv2/types/types.go b/service/lexmodelsv2/types/types.go index 4694bdae4ee..a12756ca437 100644 --- a/service/lexmodelsv2/types/types.go +++ b/service/lexmodelsv2/types/types.go @@ -1049,6 +1049,9 @@ type AudioLogSetting struct { // This member is required. Enabled bool + // The option to enable selective conversation log capture for audio. + SelectiveLoggingEnabled *bool + noSmithyDocumentSerde } @@ -4518,6 +4521,9 @@ type TextLogSetting struct { // This member is required. Enabled bool + // The option to enable selective conversation log capture for text. + SelectiveLoggingEnabled *bool + noSmithyDocumentSerde } diff --git a/service/omics/api_op_GetRun.go b/service/omics/api_op_GetRun.go index 0b32a6a7916..cc519abe2ba 100644 --- a/service/omics/api_op_GetRun.go +++ b/service/omics/api_op_GetRun.go @@ -106,6 +106,9 @@ type GetRunOutput struct { // The run's ID. RunId *string + // The destination for workflow outputs. + RunOutputUri *string + // When the run started. StartTime *time.Time @@ -127,6 +130,9 @@ type GetRunOutput struct { // The run's tags. Tags map[string]string + // The universally unique identifier for a run. + Uuid *string + // The run's workflow ID. WorkflowId *string diff --git a/service/omics/api_op_StartRun.go b/service/omics/api_op_StartRun.go index 652a8d0157f..d0efc209b1f 100644 --- a/service/omics/api_op_StartRun.go +++ b/service/omics/api_op_StartRun.go @@ -97,12 +97,18 @@ type StartRunOutput struct { // The run's ID. Id *string + // The destination for workflow outputs. + RunOutputUri *string + // The run's status. Status types.RunStatus // The run's tags. Tags map[string]string + // The universally unique identifier for a run. + Uuid *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/omics/deserializers.go b/service/omics/deserializers.go index ecff29c09b7..9667107ee86 100644 --- a/service/omics/deserializers.go +++ b/service/omics/deserializers.go @@ -7200,6 +7200,15 @@ func awsRestjson1_deserializeOpDocumentGetRunOutput(v **GetRunOutput, value inte sv.RunId = ptr.String(jtv) } + case "runOutputUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RunOutputUri to be of type string, got %T instead", value) + } + sv.RunOutputUri = ptr.String(jtv) + } + case "startedBy": if value != nil { jtv, ok := value.(string) @@ -7271,6 +7280,15 @@ func awsRestjson1_deserializeOpDocumentGetRunOutput(v **GetRunOutput, value inte return err } + case "uuid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RunUuid to be of type string, got %T instead", value) + } + sv.Uuid = ptr.String(jtv) + } + case "workflowId": if value != nil { jtv, ok := value.(string) @@ -13849,6 +13867,15 @@ func awsRestjson1_deserializeOpDocumentStartRunOutput(v **StartRunOutput, value sv.Id = ptr.String(jtv) } + case "runOutputUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RunOutputUri to be of type string, got %T instead", value) + } + sv.RunOutputUri = ptr.String(jtv) + } + case "status": if value != nil { jtv, ok := value.(string) @@ -13863,6 +13890,15 @@ func awsRestjson1_deserializeOpDocumentStartRunOutput(v **StartRunOutput, value return err } + case "uuid": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RunUuid to be of type string, got %T instead", value) + } + sv.Uuid = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/rds/api_op_CreateCustomDBEngineVersion.go b/service/rds/api_op_CreateCustomDBEngineVersion.go index 724ea98fd47..e4b6a1ff96f 100644 --- a/service/rds/api_op_CreateCustomDBEngineVersion.go +++ b/service/rds/api_op_CreateCustomDBEngineVersion.go @@ -94,14 +94,19 @@ type CreateCustomDBEngineVersionInput struct { // in the Amazon RDS User Guide. Manifest *string - // Reserved for future use. + // The ARN of a CEV to use as a source for creating a new CEV. You can specify a + // different Amazon Machine Imagine (AMI) by using either Source or + // UseAwsProvidedLatestImage . You can't specify a different JSON manifest when you + // specify SourceCustomDbEngineVersionIdentifier . SourceCustomDbEngineVersionIdentifier *string // A list of tags. For more information, see Tagging Amazon RDS Resources (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html) // in the Amazon RDS User Guide. Tags []types.Tag - // Reserved for future use. + // Specifies whether to use the latest service-provided Amazon Machine Image (AMI) + // for the CEV. If you specify UseAwsProvidedLatestImage , you can't also specify + // ImageId . UseAwsProvidedLatestImage *bool noSmithyDocumentSerde diff --git a/service/rds/endpoints_test.go b/service/rds/endpoints_test.go index e612784a8fe..e7752bf7759 100644 --- a/service/rds/endpoints_test.go +++ b/service/rds/endpoints_test.go @@ -1985,23 +1985,3 @@ func TestEndpointCase53(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } - -// Partition doesn't support DualStack -func TestEndpointCase54(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} diff --git a/service/redshiftserverless/api_op_CreateWorkgroup.go b/service/redshiftserverless/api_op_CreateWorkgroup.go index cc361424b61..949bcef4352 100644 --- a/service/redshiftserverless/api_op_CreateWorkgroup.go +++ b/service/redshiftserverless/api_op_CreateWorkgroup.go @@ -62,6 +62,10 @@ type CreateWorkgroupInput struct { // your VPC instead of over the internet. EnhancedVpcRouting *bool + // The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve + // queries. The max capacity is specified in RPUs. + MaxCapacity *int32 + // The custom port to use when connecting to a workgroup. Valid port ranges are // 5431-5455 and 8191-8215. The default is 5439. Port *int32 diff --git a/service/redshiftserverless/api_op_UpdateWorkgroup.go b/service/redshiftserverless/api_op_UpdateWorkgroup.go index 93fdd8d94c6..922713f6c89 100644 --- a/service/redshiftserverless/api_op_UpdateWorkgroup.go +++ b/service/redshiftserverless/api_op_UpdateWorkgroup.go @@ -59,6 +59,10 @@ type UpdateWorkgroupInput struct { // your VPC. EnhancedVpcRouting *bool + // The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve + // queries. The max capacity is specified in RPUs. + MaxCapacity *int32 + // The custom port to use when connecting to a workgroup. Valid port ranges are // 5431-5455 and 8191-8215. The default is 5439. Port *int32 diff --git a/service/redshiftserverless/deserializers.go b/service/redshiftserverless/deserializers.go index 7357e46227d..035344b7880 100644 --- a/service/redshiftserverless/deserializers.go +++ b/service/redshiftserverless/deserializers.go @@ -8361,6 +8361,19 @@ func awsAwsjson11_deserializeDocumentWorkgroup(v **types.Workgroup, value interf sv.EnhancedVpcRouting = ptr.Bool(jtv) } + case "maxCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxCapacity = ptr.Int32(int32(i64)) + } + case "namespaceName": if value != nil { jtv, ok := value.(string) diff --git a/service/redshiftserverless/serializers.go b/service/redshiftserverless/serializers.go index 3107d7ec4a4..a7b5c51b3e8 100644 --- a/service/redshiftserverless/serializers.go +++ b/service/redshiftserverless/serializers.go @@ -2848,6 +2848,11 @@ func awsAwsjson11_serializeOpDocumentCreateWorkgroupInput(v *CreateWorkgroupInpu ok.Boolean(*v.EnhancedVpcRouting) } + if v.MaxCapacity != nil { + ok := object.Key("maxCapacity") + ok.Integer(*v.MaxCapacity) + } + if v.NamespaceName != nil { ok := object.Key("namespaceName") ok.String(*v.NamespaceName) @@ -3707,6 +3712,11 @@ func awsAwsjson11_serializeOpDocumentUpdateWorkgroupInput(v *UpdateWorkgroupInpu ok.Boolean(*v.EnhancedVpcRouting) } + if v.MaxCapacity != nil { + ok := object.Key("maxCapacity") + ok.Integer(*v.MaxCapacity) + } + if v.Port != nil { ok := object.Key("port") ok.Integer(*v.Port) diff --git a/service/redshiftserverless/types/types.go b/service/redshiftserverless/types/types.go index 9c61c1d4a7c..c9ab443f102 100644 --- a/service/redshiftserverless/types/types.go +++ b/service/redshiftserverless/types/types.go @@ -450,6 +450,10 @@ type Workgroup struct { // VPC. EnhancedVpcRouting *bool + // The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve + // queries. The max capacity is specified in RPUs. + MaxCapacity *int32 + // The namespace the workgroup is associated with. NamespaceName *string diff --git a/service/resiliencehub/deserializers.go b/service/resiliencehub/deserializers.go index 8b33651364b..1c73b5b2b8a 100644 --- a/service/resiliencehub/deserializers.go +++ b/service/resiliencehub/deserializers.go @@ -9695,6 +9695,15 @@ func awsRestjson1_deserializeDocumentAlarmRecommendation(v **types.AlarmRecommen sv.RecommendationId = ptr.String(jtv) } + case "recommendationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.RecommendationStatus = types.RecommendationStatus(jtv) + } + case "referenceId": if value != nil { jtv, ok := value.(string) @@ -13520,6 +13529,11 @@ func awsRestjson1_deserializeDocumentResiliencyScore(v **types.ResiliencyScore, for key, value := range shape { switch key { + case "componentScore": + if err := awsRestjson1_deserializeDocumentScoringComponentResiliencyScores(&sv.ComponentScore, value); err != nil { + return err + } + case "disruptionScore": if err := awsRestjson1_deserializeDocumentDisruptionResiliencyScore(&sv.DisruptionScore, value); err != nil { return err @@ -13945,6 +13959,166 @@ func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value inte return nil } +func awsRestjson1_deserializeDocumentScoringComponentResiliencyScore(v **types.ScoringComponentResiliencyScore, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ScoringComponentResiliencyScore + if *v == nil { + sv = &types.ScoringComponentResiliencyScore{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "excludedCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExcludedCount = i64 + } + + case "outstandingCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.OutstandingCount = i64 + } + + case "possibleScore": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PossibleScore = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.PossibleScore = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "score": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Score = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Score = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScoringComponentResiliencyScores(v *map[string]types.ScoringComponentResiliencyScore, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.ScoringComponentResiliencyScore + if *v == nil { + mv = map[string]types.ScoringComponentResiliencyScore{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ScoringComponentResiliencyScore + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentScoringComponentResiliencyScore(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14057,6 +14231,15 @@ func awsRestjson1_deserializeDocumentSopRecommendation(v **types.SopRecommendati sv.RecommendationId = ptr.String(jtv) } + case "recommendationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.RecommendationStatus = types.RecommendationStatus(jtv) + } + case "referenceId": if value != nil { jtv, ok := value.(string) @@ -14350,6 +14533,15 @@ func awsRestjson1_deserializeDocumentTestRecommendation(v **types.TestRecommenda sv.RecommendationId = ptr.String(jtv) } + case "recommendationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value) + } + sv.RecommendationStatus = types.RecommendationStatus(jtv) + } + case "referenceId": if value != nil { jtv, ok := value.(string) diff --git a/service/resiliencehub/types/enums.go b/service/resiliencehub/types/enums.go index b3253f9588a..1c66cdb35bf 100644 --- a/service/resiliencehub/types/enums.go +++ b/service/resiliencehub/types/enums.go @@ -446,6 +446,28 @@ func (RecommendationComplianceStatus) Values() []RecommendationComplianceStatus } } +type RecommendationStatus string + +// Enum values for RecommendationStatus +const ( + RecommendationStatusImplemented RecommendationStatus = "Implemented" + RecommendationStatusInactive RecommendationStatus = "Inactive" + RecommendationStatusNotImplemented RecommendationStatus = "NotImplemented" + RecommendationStatusExcluded RecommendationStatus = "Excluded" +) + +// Values returns all known values for RecommendationStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (RecommendationStatus) Values() []RecommendationStatus { + return []RecommendationStatus{ + "Implemented", + "Inactive", + "NotImplemented", + "Excluded", + } +} + type RecommendationTemplateStatus string // Enum values for RecommendationTemplateStatus @@ -515,6 +537,28 @@ func (ResiliencyPolicyTier) Values() []ResiliencyPolicyTier { } } +type ResiliencyScoreType string + +// Enum values for ResiliencyScoreType +const ( + ResiliencyScoreTypeCompliance ResiliencyScoreType = "Compliance" + ResiliencyScoreTypeTest ResiliencyScoreType = "Test" + ResiliencyScoreTypeAlarm ResiliencyScoreType = "Alarm" + ResiliencyScoreTypeSop ResiliencyScoreType = "Sop" +) + +// Values returns all known values for ResiliencyScoreType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ResiliencyScoreType) Values() []ResiliencyScoreType { + return []ResiliencyScoreType{ + "Compliance", + "Test", + "Alarm", + "Sop", + } +} + type ResourceImportStatusType string // Enum values for ResourceImportStatusType diff --git a/service/resiliencehub/types/types.go b/service/resiliencehub/types/types.go index 9838877abb4..ea7add2e1e0 100644 --- a/service/resiliencehub/types/types.go +++ b/service/resiliencehub/types/types.go @@ -50,6 +50,9 @@ type AlarmRecommendation struct { // The prerequisite for the alarm recommendation. Prerequisite *string + // Status of the recommended Amazon CloudWatch alarm. + RecommendationStatus RecommendationStatus + noSmithyDocumentSerde } @@ -769,9 +772,10 @@ type PermissionModel struct { // Existing Amazon Web Services IAM role name in the primary Amazon Web Services // account that will be assumed by Resilience Hub Service Principle to obtain a - // read-only access to your application resources while running an assessment. You - // must have iam:passRole permission for this role while creating or updating the - // application. + // read-only access to your application resources while running an assessment. + // - You must have iam:passRole permission for this role while creating or + // updating the application. + // - Currently, invokerRoleName accepts only [A-Za-z0-9_+=,.@-] characters. InvokerRoleName *string noSmithyDocumentSerde @@ -792,7 +796,7 @@ type PhysicalResource struct { // This member is required. PhysicalResourceId *PhysicalResourceId - // Type of resource. + // The type of resource. // // This member is required. ResourceType *string @@ -1052,6 +1056,12 @@ type ResiliencyScore struct { // This member is required. Score float64 + // The score generated by Resilience Hub for the scoring component after running + // an assessment. For example, if the score is 25 points, it indicates the overall + // score of your application generated by Resilience Hub after running an + // assessment. + ComponentScore map[string]ScoringComponentResiliencyScore + noSmithyDocumentSerde } @@ -1137,6 +1147,38 @@ type S3Location struct { noSmithyDocumentSerde } +// Resiliency score of each scoring component. For more information about scoring +// component, see Calculating resiliency score (https://docs.aws.amazon.com/resilience-hub/latest/userguide/calculate-score.html) +// . +type ScoringComponentResiliencyScore struct { + + // Number of recommendations that were excluded from the assessment. For example, + // if the Excluded count for Resilience Hub recommended Amazon CloudWatch alarms + // is 7, it indicates that 7 Amazon CloudWatch alarms are excluded from the + // assessment. + ExcludedCount int64 + + // Number of issues that must be resolved to obtain the maximum possible score for + // the scoring component. For SOPs, alarms, and FIS experiments, these are the + // number of recommendations that must be implemented. For compliance, it is the + // number of Application Components that has breached the resiliency policy. For + // example, if the Outstanding count for Resilience Hub recommended Amazon + // CloudWatch alarms is 5, it indicates that 5 Amazon CloudWatch alarms must be + // fixed to achieve the maximum possible score. + OutstandingCount int64 + + // Maximum possible score that can be obtained for the scoring component. If the + // Possible score is 20 points, it indicates the maximum possible score you can + // achieve for your application when you run a new assessment after implementing + // all the Resilience Hub recommendations. + PossibleScore float64 + + // Resiliency score of your application. + Score float64 + + noSmithyDocumentSerde +} + // Defines a standard operating procedure (SOP) recommendation. type SopRecommendation struct { @@ -1170,6 +1212,9 @@ type SopRecommendation struct { // Prerequisite for the SOP recommendation. Prerequisite *string + // Status of the recommended standard operating procedure. + RecommendationStatus RecommendationStatus + noSmithyDocumentSerde } @@ -1217,6 +1262,9 @@ type TestRecommendation struct { // Identifier for the test recommendation. RecommendationId *string + // Status of the recommended test. + RecommendationStatus RecommendationStatus + // Level of risk for this test recommendation. Risk TestRisk diff --git a/service/sqs/api_op_AddPermission.go b/service/sqs/api_op_AddPermission.go index 8c47df85a87..21306d904c2 100644 --- a/service/sqs/api_op_AddPermission.go +++ b/service/sqs/api_op_AddPermission.go @@ -95,11 +95,11 @@ type AddPermissionOutput struct { } func (c *Client) addOperationAddPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpAddPermission{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpAddPermission{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddPermission{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpAddPermission{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_CancelMessageMoveTask.go b/service/sqs/api_op_CancelMessageMoveTask.go index 694519f3186..5c28d17c886 100644 --- a/service/sqs/api_op_CancelMessageMoveTask.go +++ b/service/sqs/api_op_CancelMessageMoveTask.go @@ -64,11 +64,11 @@ type CancelMessageMoveTaskOutput struct { } func (c *Client) addOperationCancelMessageMoveTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpCancelMessageMoveTask{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCancelMessageMoveTask{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCancelMessageMoveTask{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCancelMessageMoveTask{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ChangeMessageVisibility.go b/service/sqs/api_op_ChangeMessageVisibility.go index 14a57793e9b..689f1ded281 100644 --- a/service/sqs/api_op_ChangeMessageVisibility.go +++ b/service/sqs/api_op_ChangeMessageVisibility.go @@ -102,11 +102,11 @@ type ChangeMessageVisibilityOutput struct { } func (c *Client) addOperationChangeMessageVisibilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpChangeMessageVisibility{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpChangeMessageVisibility{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpChangeMessageVisibility{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpChangeMessageVisibility{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ChangeMessageVisibilityBatch.go b/service/sqs/api_op_ChangeMessageVisibilityBatch.go index d216b751149..5f8bd19b6c2 100644 --- a/service/sqs/api_op_ChangeMessageVisibilityBatch.go +++ b/service/sqs/api_op_ChangeMessageVisibilityBatch.go @@ -77,11 +77,11 @@ type ChangeMessageVisibilityBatchOutput struct { } func (c *Client) addOperationChangeMessageVisibilityBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpChangeMessageVisibilityBatch{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpChangeMessageVisibilityBatch{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpChangeMessageVisibilityBatch{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpChangeMessageVisibilityBatch{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_CreateQueue.go b/service/sqs/api_op_CreateQueue.go index 0600052995f..c19ff4159e3 100644 --- a/service/sqs/api_op_CreateQueue.go +++ b/service/sqs/api_op_CreateQueue.go @@ -229,11 +229,11 @@ type CreateQueueOutput struct { } func (c *Client) addOperationCreateQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateQueue{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateQueue{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateQueue{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateQueue{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_DeleteMessage.go b/service/sqs/api_op_DeleteMessage.go index 5f0c8048ed4..520d35cf47e 100644 --- a/service/sqs/api_op_DeleteMessage.go +++ b/service/sqs/api_op_DeleteMessage.go @@ -71,11 +71,11 @@ type DeleteMessageOutput struct { } func (c *Client) addOperationDeleteMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteMessage{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteMessage{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteMessage{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteMessage{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_DeleteMessageBatch.go b/service/sqs/api_op_DeleteMessageBatch.go index 439dc99c752..2f13c15820c 100644 --- a/service/sqs/api_op_DeleteMessageBatch.go +++ b/service/sqs/api_op_DeleteMessageBatch.go @@ -74,11 +74,11 @@ type DeleteMessageBatchOutput struct { } func (c *Client) addOperationDeleteMessageBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteMessageBatch{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteMessageBatch{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteMessageBatch{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteMessageBatch{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_DeleteQueue.go b/service/sqs/api_op_DeleteQueue.go index de4f4fed5b5..8c1c339b11c 100644 --- a/service/sqs/api_op_DeleteQueue.go +++ b/service/sqs/api_op_DeleteQueue.go @@ -60,11 +60,11 @@ type DeleteQueueOutput struct { } func (c *Client) addOperationDeleteQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteQueue{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteQueue{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteQueue{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteQueue{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_GetQueueAttributes.go b/service/sqs/api_op_GetQueueAttributes.go index 533aa358b1f..144f82a97e8 100644 --- a/service/sqs/api_op_GetQueueAttributes.go +++ b/service/sqs/api_op_GetQueueAttributes.go @@ -171,11 +171,11 @@ type GetQueueAttributesOutput struct { } func (c *Client) addOperationGetQueueAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpGetQueueAttributes{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetQueueAttributes{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetQueueAttributes{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetQueueAttributes{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_GetQueueUrl.go b/service/sqs/api_op_GetQueueUrl.go index 8c93e03ad3c..cf89e82e7a9 100644 --- a/service/sqs/api_op_GetQueueUrl.go +++ b/service/sqs/api_op_GetQueueUrl.go @@ -65,11 +65,11 @@ type GetQueueUrlOutput struct { } func (c *Client) addOperationGetQueueUrlMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpGetQueueUrl{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetQueueUrl{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetQueueUrl{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetQueueUrl{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ListDeadLetterSourceQueues.go b/service/sqs/api_op_ListDeadLetterSourceQueues.go index 4b9402259dc..fccab95e8dc 100644 --- a/service/sqs/api_op_ListDeadLetterSourceQueues.go +++ b/service/sqs/api_op_ListDeadLetterSourceQueues.go @@ -79,11 +79,11 @@ type ListDeadLetterSourceQueuesOutput struct { } func (c *Client) addOperationListDeadLetterSourceQueuesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpListDeadLetterSourceQueues{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListDeadLetterSourceQueues{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListDeadLetterSourceQueues{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListDeadLetterSourceQueues{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ListMessageMoveTasks.go b/service/sqs/api_op_ListMessageMoveTasks.go index f69c3da90df..e8f6b07dbde 100644 --- a/service/sqs/api_op_ListMessageMoveTasks.go +++ b/service/sqs/api_op_ListMessageMoveTasks.go @@ -50,7 +50,7 @@ type ListMessageMoveTasksInput struct { // The maximum number of results to include in the response. The default is 1, // which provides the most recent message movement task. The upper limit is 10. - MaxResults int32 + MaxResults *int32 noSmithyDocumentSerde } @@ -67,11 +67,11 @@ type ListMessageMoveTasksOutput struct { } func (c *Client) addOperationListMessageMoveTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpListMessageMoveTasks{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListMessageMoveTasks{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListMessageMoveTasks{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListMessageMoveTasks{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ListQueueTags.go b/service/sqs/api_op_ListQueueTags.go index edc7b1ae9f8..9c762726611 100644 --- a/service/sqs/api_op_ListQueueTags.go +++ b/service/sqs/api_op_ListQueueTags.go @@ -58,11 +58,11 @@ type ListQueueTagsOutput struct { } func (c *Client) addOperationListQueueTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpListQueueTags{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListQueueTags{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListQueueTags{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListQueueTags{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ListQueues.go b/service/sqs/api_op_ListQueues.go index d85716572a7..093410d0ceb 100644 --- a/service/sqs/api_op_ListQueues.go +++ b/service/sqs/api_op_ListQueues.go @@ -78,11 +78,11 @@ type ListQueuesOutput struct { } func (c *Client) addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpListQueues{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListQueues{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListQueues{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListQueues{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_PurgeQueue.go b/service/sqs/api_op_PurgeQueue.go index 2c4daf9cd5b..2916913522f 100644 --- a/service/sqs/api_op_PurgeQueue.go +++ b/service/sqs/api_op_PurgeQueue.go @@ -56,11 +56,11 @@ type PurgeQueueOutput struct { } func (c *Client) addOperationPurgeQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpPurgeQueue{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpPurgeQueue{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPurgeQueue{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPurgeQueue{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_ReceiveMessage.go b/service/sqs/api_op_ReceiveMessage.go index f858879f603..6d4bb737a4c 100644 --- a/service/sqs/api_op_ReceiveMessage.go +++ b/service/sqs/api_op_ReceiveMessage.go @@ -193,11 +193,11 @@ type ReceiveMessageOutput struct { } func (c *Client) addOperationReceiveMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpReceiveMessage{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpReceiveMessage{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpReceiveMessage{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpReceiveMessage{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_RemovePermission.go b/service/sqs/api_op_RemovePermission.go index 382603bca06..e000caa391b 100644 --- a/service/sqs/api_op_RemovePermission.go +++ b/service/sqs/api_op_RemovePermission.go @@ -64,11 +64,11 @@ type RemovePermissionOutput struct { } func (c *Client) addOperationRemovePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpRemovePermission{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpRemovePermission{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemovePermission{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpRemovePermission{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_SendMessage.go b/service/sqs/api_op_SendMessage.go index 37d5b797ce7..a7c30124653 100644 --- a/service/sqs/api_op_SendMessage.go +++ b/service/sqs/api_op_SendMessage.go @@ -174,11 +174,11 @@ type SendMessageOutput struct { } func (c *Client) addOperationSendMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpSendMessage{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpSendMessage{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendMessage{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSendMessage{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_SendMessageBatch.go b/service/sqs/api_op_SendMessageBatch.go index 5e27a8dc612..96aa9043e35 100644 --- a/service/sqs/api_op_SendMessageBatch.go +++ b/service/sqs/api_op_SendMessageBatch.go @@ -86,11 +86,11 @@ type SendMessageBatchOutput struct { } func (c *Client) addOperationSendMessageBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpSendMessageBatch{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpSendMessageBatch{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSendMessageBatch{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSendMessageBatch{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_SetQueueAttributes.go b/service/sqs/api_op_SetQueueAttributes.go index afb851f7cca..fde5ba245d6 100644 --- a/service/sqs/api_op_SetQueueAttributes.go +++ b/service/sqs/api_op_SetQueueAttributes.go @@ -186,11 +186,11 @@ type SetQueueAttributesOutput struct { } func (c *Client) addOperationSetQueueAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpSetQueueAttributes{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpSetQueueAttributes{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSetQueueAttributes{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSetQueueAttributes{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_StartMessageMoveTask.go b/service/sqs/api_op_StartMessageMoveTask.go index 8d5e25bcfcd..05ad62395da 100644 --- a/service/sqs/api_op_StartMessageMoveTask.go +++ b/service/sqs/api_op_StartMessageMoveTask.go @@ -65,7 +65,7 @@ type StartMessageMoveTaskInput struct { // for messages per second is 500. If this field is left blank, the system will // optimize the rate based on the queue message backlog size, which may vary // throughout the duration of the message movement task. - MaxNumberOfMessagesPerSecond int32 + MaxNumberOfMessagesPerSecond *int32 noSmithyDocumentSerde } @@ -84,11 +84,11 @@ type StartMessageMoveTaskOutput struct { } func (c *Client) addOperationStartMessageMoveTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpStartMessageMoveTask{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartMessageMoveTask{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartMessageMoveTask{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartMessageMoveTask{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_TagQueue.go b/service/sqs/api_op_TagQueue.go index 02fe9ab7bd0..a3ce0465c79 100644 --- a/service/sqs/api_op_TagQueue.go +++ b/service/sqs/api_op_TagQueue.go @@ -69,11 +69,11 @@ type TagQueueOutput struct { } func (c *Client) addOperationTagQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpTagQueue{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpTagQueue{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpTagQueue{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpTagQueue{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/api_op_UntagQueue.go b/service/sqs/api_op_UntagQueue.go index f2ec6a71f7e..b235e8743b8 100644 --- a/service/sqs/api_op_UntagQueue.go +++ b/service/sqs/api_op_UntagQueue.go @@ -59,11 +59,11 @@ type UntagQueueOutput struct { } func (c *Client) addOperationUntagQueueMiddlewares(stack *middleware.Stack, options Options) (err error) { - err = stack.Serialize.Add(&awsAwsquery_serializeOpUntagQueue{}, middleware.After) + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUntagQueue{}, middleware.After) if err != nil { return err } - err = stack.Deserialize.Add(&awsAwsquery_deserializeOpUntagQueue{}, middleware.After) + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUntagQueue{}, middleware.After) if err != nil { return err } diff --git a/service/sqs/deserializers.go b/service/sqs/deserializers.go index 171c7fc96fd..4916f3799ba 100644 --- a/service/sqs/deserializers.go +++ b/service/sqs/deserializers.go @@ -6,31 +6,28 @@ import ( "bytes" "context" "encoding/base64" - "encoding/xml" + "encoding/json" "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/sqs/types" smithy "github.com/aws/smithy-go" - smithyxml "github.com/aws/smithy-go/encoding/xml" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" - "strconv" "strings" ) -type awsAwsquery_deserializeOpAddPermission struct { +type awsAwsjson10_deserializeOpAddPermission struct { } -func (*awsAwsquery_deserializeOpAddPermission) ID() string { +func (*awsAwsjson10_deserializeOpAddPermission) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpAddPermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpAddPermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -44,7 +41,7 @@ func (m *awsAwsquery_deserializeOpAddPermission) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorAddPermission(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorAddPermission(response, &metadata) } output := &AddPermissionOutput{} out.Result = output @@ -58,7 +55,7 @@ func (m *awsAwsquery_deserializeOpAddPermission) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsquery_deserializeOpErrorAddPermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorAddPermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -68,25 +65,60 @@ func awsAwsquery_deserializeOpErrorAddPermission(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + case strings.EqualFold("OverLimit", errorCode): - return awsAwsquery_deserializeErrorOverLimit(response, errorBody) + return awsAwsjson10_deserializeErrorOverLimit(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -96,14 +128,14 @@ func awsAwsquery_deserializeOpErrorAddPermission(response *smithyhttp.Response, } } -type awsAwsquery_deserializeOpCancelMessageMoveTask struct { +type awsAwsjson10_deserializeOpCancelMessageMoveTask struct { } -func (*awsAwsquery_deserializeOpCancelMessageMoveTask) ID() string { +func (*awsAwsjson10_deserializeOpCancelMessageMoveTask) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpCancelMessageMoveTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpCancelMessageMoveTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -117,31 +149,19 @@ func (m *awsAwsquery_deserializeOpCancelMessageMoveTask) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorCancelMessageMoveTask(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorCancelMessageMoveTask(response, &metadata) } output := &CancelMessageMoveTaskOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("CancelMessageMoveTaskResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -151,8 +171,7 @@ func (m *awsAwsquery_deserializeOpCancelMessageMoveTask) HandleDeserialize(ctx c return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentCancelMessageMoveTaskOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentCancelMessageMoveTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -166,7 +185,7 @@ func (m *awsAwsquery_deserializeOpCancelMessageMoveTask) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsquery_deserializeOpErrorCancelMessageMoveTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorCancelMessageMoveTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -176,28 +195,57 @@ func awsAwsquery_deserializeOpErrorCancelMessageMoveTask(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.UnsupportedOperation", errorCode): - return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -207,14 +255,14 @@ func awsAwsquery_deserializeOpErrorCancelMessageMoveTask(response *smithyhttp.Re } } -type awsAwsquery_deserializeOpChangeMessageVisibility struct { +type awsAwsjson10_deserializeOpChangeMessageVisibility struct { } -func (*awsAwsquery_deserializeOpChangeMessageVisibility) ID() string { +func (*awsAwsjson10_deserializeOpChangeMessageVisibility) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpChangeMessageVisibility) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpChangeMessageVisibility) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -228,7 +276,7 @@ func (m *awsAwsquery_deserializeOpChangeMessageVisibility) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorChangeMessageVisibility(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorChangeMessageVisibility(response, &metadata) } output := &ChangeMessageVisibilityOutput{} out.Result = output @@ -242,7 +290,7 @@ func (m *awsAwsquery_deserializeOpChangeMessageVisibility) HandleDeserialize(ctx return out, metadata, err } -func awsAwsquery_deserializeOpErrorChangeMessageVisibility(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorChangeMessageVisibility(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -252,28 +300,63 @@ func awsAwsquery_deserializeOpErrorChangeMessageVisibility(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.MessageNotInflight", errorCode): - return awsAwsquery_deserializeErrorMessageNotInflight(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("MessageNotInflight", errorCode): + return awsAwsjson10_deserializeErrorMessageNotInflight(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) case strings.EqualFold("ReceiptHandleIsInvalid", errorCode): - return awsAwsquery_deserializeErrorReceiptHandleIsInvalid(response, errorBody) + return awsAwsjson10_deserializeErrorReceiptHandleIsInvalid(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -283,14 +366,14 @@ func awsAwsquery_deserializeOpErrorChangeMessageVisibility(response *smithyhttp. } } -type awsAwsquery_deserializeOpChangeMessageVisibilityBatch struct { +type awsAwsjson10_deserializeOpChangeMessageVisibilityBatch struct { } -func (*awsAwsquery_deserializeOpChangeMessageVisibilityBatch) ID() string { +func (*awsAwsjson10_deserializeOpChangeMessageVisibilityBatch) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpChangeMessageVisibilityBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpChangeMessageVisibilityBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -304,31 +387,19 @@ func (m *awsAwsquery_deserializeOpChangeMessageVisibilityBatch) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorChangeMessageVisibilityBatch(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorChangeMessageVisibilityBatch(response, &metadata) } output := &ChangeMessageVisibilityBatchOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ChangeMessageVisibilityBatchResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -338,8 +409,7 @@ func (m *awsAwsquery_deserializeOpChangeMessageVisibilityBatch) HandleDeserializ return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentChangeMessageVisibilityBatchOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentChangeMessageVisibilityBatchOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -353,7 +423,7 @@ func (m *awsAwsquery_deserializeOpChangeMessageVisibilityBatch) HandleDeserializ return out, metadata, err } -func awsAwsquery_deserializeOpErrorChangeMessageVisibilityBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorChangeMessageVisibilityBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -363,34 +433,69 @@ func awsAwsquery_deserializeOpErrorChangeMessageVisibilityBatch(response *smithy errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.BatchEntryIdsNotDistinct", errorCode): - return awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) + case strings.EqualFold("BatchEntryIdsNotDistinct", errorCode): + return awsAwsjson10_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.EmptyBatchRequest", errorCode): - return awsAwsquery_deserializeErrorEmptyBatchRequest(response, errorBody) + case strings.EqualFold("EmptyBatchRequest", errorCode): + return awsAwsjson10_deserializeErrorEmptyBatchRequest(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.InvalidBatchEntryId", errorCode): - return awsAwsquery_deserializeErrorInvalidBatchEntryId(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.TooManyEntriesInBatchRequest", errorCode): - return awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) + case strings.EqualFold("InvalidBatchEntryId", errorCode): + return awsAwsjson10_deserializeErrorInvalidBatchEntryId(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("TooManyEntriesInBatchRequest", errorCode): + return awsAwsjson10_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -400,14 +505,14 @@ func awsAwsquery_deserializeOpErrorChangeMessageVisibilityBatch(response *smithy } } -type awsAwsquery_deserializeOpCreateQueue struct { +type awsAwsjson10_deserializeOpCreateQueue struct { } -func (*awsAwsquery_deserializeOpCreateQueue) ID() string { +func (*awsAwsjson10_deserializeOpCreateQueue) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpCreateQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpCreateQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -421,31 +526,19 @@ func (m *awsAwsquery_deserializeOpCreateQueue) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorCreateQueue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorCreateQueue(response, &metadata) } output := &CreateQueueOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("CreateQueueResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -455,8 +548,7 @@ func (m *awsAwsquery_deserializeOpCreateQueue) HandleDeserialize(ctx context.Con return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentCreateQueueOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentCreateQueueOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -470,7 +562,7 @@ func (m *awsAwsquery_deserializeOpCreateQueue) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsquery_deserializeOpErrorCreateQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorCreateQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -480,28 +572,66 @@ func awsAwsquery_deserializeOpErrorCreateQueue(response *smithyhttp.Response, me errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.QueueDeletedRecently", errorCode): - return awsAwsquery_deserializeErrorQueueDeletedRecently(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidAttributeName", errorCode): + return awsAwsjson10_deserializeErrorInvalidAttributeName(response, errorBody) + + case strings.EqualFold("InvalidAttributeValue", errorCode): + return awsAwsjson10_deserializeErrorInvalidAttributeValue(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDeletedRecently", errorCode): + return awsAwsjson10_deserializeErrorQueueDeletedRecently(response, errorBody) + + case strings.EqualFold("QueueNameExists", errorCode): + return awsAwsjson10_deserializeErrorQueueNameExists(response, errorBody) - case strings.EqualFold("QueueAlreadyExists", errorCode): - return awsAwsquery_deserializeErrorQueueNameExists(response, errorBody) + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -511,14 +641,14 @@ func awsAwsquery_deserializeOpErrorCreateQueue(response *smithyhttp.Response, me } } -type awsAwsquery_deserializeOpDeleteMessage struct { +type awsAwsjson10_deserializeOpDeleteMessage struct { } -func (*awsAwsquery_deserializeOpDeleteMessage) ID() string { +func (*awsAwsjson10_deserializeOpDeleteMessage) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -532,7 +662,7 @@ func (m *awsAwsquery_deserializeOpDeleteMessage) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteMessage(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteMessage(response, &metadata) } output := &DeleteMessageOutput{} out.Result = output @@ -546,7 +676,7 @@ func (m *awsAwsquery_deserializeOpDeleteMessage) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -556,28 +686,63 @@ func awsAwsquery_deserializeOpErrorDeleteMessage(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + case strings.EqualFold("InvalidIdFormat", errorCode): - return awsAwsquery_deserializeErrorInvalidIdFormat(response, errorBody) + return awsAwsjson10_deserializeErrorInvalidIdFormat(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) case strings.EqualFold("ReceiptHandleIsInvalid", errorCode): - return awsAwsquery_deserializeErrorReceiptHandleIsInvalid(response, errorBody) + return awsAwsjson10_deserializeErrorReceiptHandleIsInvalid(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -587,14 +752,14 @@ func awsAwsquery_deserializeOpErrorDeleteMessage(response *smithyhttp.Response, } } -type awsAwsquery_deserializeOpDeleteMessageBatch struct { +type awsAwsjson10_deserializeOpDeleteMessageBatch struct { } -func (*awsAwsquery_deserializeOpDeleteMessageBatch) ID() string { +func (*awsAwsjson10_deserializeOpDeleteMessageBatch) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteMessageBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteMessageBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -608,31 +773,19 @@ func (m *awsAwsquery_deserializeOpDeleteMessageBatch) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteMessageBatch(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteMessageBatch(response, &metadata) } output := &DeleteMessageBatchOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("DeleteMessageBatchResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -642,8 +795,7 @@ func (m *awsAwsquery_deserializeOpDeleteMessageBatch) HandleDeserialize(ctx cont return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentDeleteMessageBatchOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentDeleteMessageBatchOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -657,7 +809,7 @@ func (m *awsAwsquery_deserializeOpDeleteMessageBatch) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteMessageBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteMessageBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -667,34 +819,69 @@ func awsAwsquery_deserializeOpErrorDeleteMessageBatch(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.BatchEntryIdsNotDistinct", errorCode): - return awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) + case strings.EqualFold("BatchEntryIdsNotDistinct", errorCode): + return awsAwsjson10_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) + + case strings.EqualFold("EmptyBatchRequest", errorCode): + return awsAwsjson10_deserializeErrorEmptyBatchRequest(response, errorBody) + + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidBatchEntryId", errorCode): + return awsAwsjson10_deserializeErrorInvalidBatchEntryId(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.EmptyBatchRequest", errorCode): - return awsAwsquery_deserializeErrorEmptyBatchRequest(response, errorBody) + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.InvalidBatchEntryId", errorCode): - return awsAwsquery_deserializeErrorInvalidBatchEntryId(response, errorBody) + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.TooManyEntriesInBatchRequest", errorCode): - return awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) + case strings.EqualFold("TooManyEntriesInBatchRequest", errorCode): + return awsAwsjson10_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -704,14 +891,14 @@ func awsAwsquery_deserializeOpErrorDeleteMessageBatch(response *smithyhttp.Respo } } -type awsAwsquery_deserializeOpDeleteQueue struct { +type awsAwsjson10_deserializeOpDeleteQueue struct { } -func (*awsAwsquery_deserializeOpDeleteQueue) ID() string { +func (*awsAwsjson10_deserializeOpDeleteQueue) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -725,7 +912,7 @@ func (m *awsAwsquery_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorDeleteQueue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteQueue(response, &metadata) } output := &DeleteQueueOutput{} out.Result = output @@ -739,7 +926,7 @@ func (m *awsAwsquery_deserializeOpDeleteQueue) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsquery_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -749,22 +936,57 @@ func awsAwsquery_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, me errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -774,14 +996,14 @@ func awsAwsquery_deserializeOpErrorDeleteQueue(response *smithyhttp.Response, me } } -type awsAwsquery_deserializeOpGetQueueAttributes struct { +type awsAwsjson10_deserializeOpGetQueueAttributes struct { } -func (*awsAwsquery_deserializeOpGetQueueAttributes) ID() string { +func (*awsAwsjson10_deserializeOpGetQueueAttributes) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpGetQueueAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetQueueAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -795,31 +1017,19 @@ func (m *awsAwsquery_deserializeOpGetQueueAttributes) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorGetQueueAttributes(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetQueueAttributes(response, &metadata) } output := &GetQueueAttributesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("GetQueueAttributesResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -829,8 +1039,7 @@ func (m *awsAwsquery_deserializeOpGetQueueAttributes) HandleDeserialize(ctx cont return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentGetQueueAttributesOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentGetQueueAttributesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -844,7 +1053,7 @@ func (m *awsAwsquery_deserializeOpGetQueueAttributes) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorGetQueueAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetQueueAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -854,27 +1063,62 @@ func awsAwsquery_deserializeOpErrorGetQueueAttributes(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + case strings.EqualFold("InvalidAttributeName", errorCode): - return awsAwsquery_deserializeErrorInvalidAttributeName(response, errorBody) + return awsAwsjson10_deserializeErrorInvalidAttributeName(response, errorBody) - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } + genericError := &smithy.GenericAPIError{ + Code: errorCode, Message: errorMessage, } return genericError @@ -882,14 +1126,14 @@ func awsAwsquery_deserializeOpErrorGetQueueAttributes(response *smithyhttp.Respo } } -type awsAwsquery_deserializeOpGetQueueUrl struct { +type awsAwsjson10_deserializeOpGetQueueUrl struct { } -func (*awsAwsquery_deserializeOpGetQueueUrl) ID() string { +func (*awsAwsjson10_deserializeOpGetQueueUrl) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpGetQueueUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetQueueUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -903,31 +1147,19 @@ func (m *awsAwsquery_deserializeOpGetQueueUrl) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorGetQueueUrl(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetQueueUrl(response, &metadata) } output := &GetQueueUrlOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("GetQueueUrlResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -937,8 +1169,7 @@ func (m *awsAwsquery_deserializeOpGetQueueUrl) HandleDeserialize(ctx context.Con return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentGetQueueUrlOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentGetQueueUrlOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -952,7 +1183,7 @@ func (m *awsAwsquery_deserializeOpGetQueueUrl) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsquery_deserializeOpErrorGetQueueUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetQueueUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -962,25 +1193,57 @@ func awsAwsquery_deserializeOpErrorGetQueueUrl(response *smithyhttp.Response, me errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.NonExistentQueue", errorCode): - return awsAwsquery_deserializeErrorQueueDoesNotExist(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -990,14 +1253,14 @@ func awsAwsquery_deserializeOpErrorGetQueueUrl(response *smithyhttp.Response, me } } -type awsAwsquery_deserializeOpListDeadLetterSourceQueues struct { +type awsAwsjson10_deserializeOpListDeadLetterSourceQueues struct { } -func (*awsAwsquery_deserializeOpListDeadLetterSourceQueues) ID() string { +func (*awsAwsjson10_deserializeOpListDeadLetterSourceQueues) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpListDeadLetterSourceQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListDeadLetterSourceQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1011,31 +1274,19 @@ func (m *awsAwsquery_deserializeOpListDeadLetterSourceQueues) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorListDeadLetterSourceQueues(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListDeadLetterSourceQueues(response, &metadata) } output := &ListDeadLetterSourceQueuesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ListDeadLetterSourceQueuesResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1045,8 +1296,7 @@ func (m *awsAwsquery_deserializeOpListDeadLetterSourceQueues) HandleDeserialize( return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentListDeadLetterSourceQueuesOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentListDeadLetterSourceQueuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1060,7 +1310,7 @@ func (m *awsAwsquery_deserializeOpListDeadLetterSourceQueues) HandleDeserialize( return out, metadata, err } -func awsAwsquery_deserializeOpErrorListDeadLetterSourceQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListDeadLetterSourceQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1070,25 +1320,57 @@ func awsAwsquery_deserializeOpErrorListDeadLetterSourceQueues(response *smithyht errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.NonExistentQueue", errorCode): - return awsAwsquery_deserializeErrorQueueDoesNotExist(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1098,14 +1380,14 @@ func awsAwsquery_deserializeOpErrorListDeadLetterSourceQueues(response *smithyht } } -type awsAwsquery_deserializeOpListMessageMoveTasks struct { +type awsAwsjson10_deserializeOpListMessageMoveTasks struct { } -func (*awsAwsquery_deserializeOpListMessageMoveTasks) ID() string { +func (*awsAwsjson10_deserializeOpListMessageMoveTasks) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpListMessageMoveTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListMessageMoveTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1119,31 +1401,19 @@ func (m *awsAwsquery_deserializeOpListMessageMoveTasks) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorListMessageMoveTasks(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListMessageMoveTasks(response, &metadata) } output := &ListMessageMoveTasksOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ListMessageMoveTasksResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1153,8 +1423,7 @@ func (m *awsAwsquery_deserializeOpListMessageMoveTasks) HandleDeserialize(ctx co return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentListMessageMoveTasksOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentListMessageMoveTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1168,7 +1437,7 @@ func (m *awsAwsquery_deserializeOpListMessageMoveTasks) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsquery_deserializeOpErrorListMessageMoveTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListMessageMoveTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1178,28 +1447,57 @@ func awsAwsquery_deserializeOpErrorListMessageMoveTasks(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.UnsupportedOperation", errorCode): - return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1209,14 +1507,14 @@ func awsAwsquery_deserializeOpErrorListMessageMoveTasks(response *smithyhttp.Res } } -type awsAwsquery_deserializeOpListQueues struct { +type awsAwsjson10_deserializeOpListQueues struct { } -func (*awsAwsquery_deserializeOpListQueues) ID() string { +func (*awsAwsjson10_deserializeOpListQueues) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpListQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1230,31 +1528,19 @@ func (m *awsAwsquery_deserializeOpListQueues) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorListQueues(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListQueues(response, &metadata) } output := &ListQueuesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ListQueuesResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1264,8 +1550,7 @@ func (m *awsAwsquery_deserializeOpListQueues) HandleDeserialize(ctx context.Cont return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentListQueuesOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentListQueuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1279,7 +1564,7 @@ func (m *awsAwsquery_deserializeOpListQueues) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorListQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1289,22 +1574,54 @@ func awsAwsquery_deserializeOpErrorListQueues(response *smithyhttp.Response, met errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1314,14 +1631,14 @@ func awsAwsquery_deserializeOpErrorListQueues(response *smithyhttp.Response, met } } -type awsAwsquery_deserializeOpListQueueTags struct { +type awsAwsjson10_deserializeOpListQueueTags struct { } -func (*awsAwsquery_deserializeOpListQueueTags) ID() string { +func (*awsAwsjson10_deserializeOpListQueueTags) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpListQueueTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListQueueTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1335,31 +1652,19 @@ func (m *awsAwsquery_deserializeOpListQueueTags) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorListQueueTags(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListQueueTags(response, &metadata) } output := &ListQueueTagsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ListQueueTagsResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1369,8 +1674,7 @@ func (m *awsAwsquery_deserializeOpListQueueTags) HandleDeserialize(ctx context.C return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentListQueueTagsOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentListQueueTagsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1384,7 +1688,7 @@ func (m *awsAwsquery_deserializeOpListQueueTags) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsquery_deserializeOpErrorListQueueTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListQueueTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1394,22 +1698,57 @@ func awsAwsquery_deserializeOpErrorListQueueTags(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1419,14 +1758,14 @@ func awsAwsquery_deserializeOpErrorListQueueTags(response *smithyhttp.Response, } } -type awsAwsquery_deserializeOpPurgeQueue struct { +type awsAwsjson10_deserializeOpPurgeQueue struct { } -func (*awsAwsquery_deserializeOpPurgeQueue) ID() string { +func (*awsAwsjson10_deserializeOpPurgeQueue) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpPurgeQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPurgeQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1440,7 +1779,7 @@ func (m *awsAwsquery_deserializeOpPurgeQueue) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorPurgeQueue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPurgeQueue(response, &metadata) } output := &PurgeQueueOutput{} out.Result = output @@ -1454,7 +1793,7 @@ func (m *awsAwsquery_deserializeOpPurgeQueue) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorPurgeQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPurgeQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1464,28 +1803,60 @@ func awsAwsquery_deserializeOpErrorPurgeQueue(response *smithyhttp.Response, met errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.NonExistentQueue", errorCode): - return awsAwsquery_deserializeErrorQueueDoesNotExist(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("PurgeQueueInProgress", errorCode): + return awsAwsjson10_deserializeErrorPurgeQueueInProgress(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.PurgeQueueInProgress", errorCode): - return awsAwsquery_deserializeErrorPurgeQueueInProgress(response, errorBody) + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1495,14 +1866,14 @@ func awsAwsquery_deserializeOpErrorPurgeQueue(response *smithyhttp.Response, met } } -type awsAwsquery_deserializeOpReceiveMessage struct { +type awsAwsjson10_deserializeOpReceiveMessage struct { } -func (*awsAwsquery_deserializeOpReceiveMessage) ID() string { +func (*awsAwsjson10_deserializeOpReceiveMessage) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpReceiveMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpReceiveMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1516,31 +1887,19 @@ func (m *awsAwsquery_deserializeOpReceiveMessage) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorReceiveMessage(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorReceiveMessage(response, &metadata) } output := &ReceiveMessageOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("ReceiveMessageResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1550,8 +1909,7 @@ func (m *awsAwsquery_deserializeOpReceiveMessage) HandleDeserialize(ctx context. return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentReceiveMessageOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentReceiveMessageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1565,7 +1923,7 @@ func (m *awsAwsquery_deserializeOpReceiveMessage) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsquery_deserializeOpErrorReceiveMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorReceiveMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1575,25 +1933,81 @@ func awsAwsquery_deserializeOpErrorReceiveMessage(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("KmsAccessDenied", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDenied(response, errorBody) + + case strings.EqualFold("KmsDisabled", errorCode): + return awsAwsjson10_deserializeErrorKmsDisabled(response, errorBody) + + case strings.EqualFold("KmsInvalidKeyUsage", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidKeyUsage(response, errorBody) + + case strings.EqualFold("KmsInvalidState", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidState(response, errorBody) + + case strings.EqualFold("KmsNotFound", errorCode): + return awsAwsjson10_deserializeErrorKmsNotFound(response, errorBody) + + case strings.EqualFold("KmsOptInRequired", errorCode): + return awsAwsjson10_deserializeErrorKmsOptInRequired(response, errorBody) + + case strings.EqualFold("KmsThrottled", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottled(response, errorBody) + case strings.EqualFold("OverLimit", errorCode): - return awsAwsquery_deserializeErrorOverLimit(response, errorBody) + return awsAwsjson10_deserializeErrorOverLimit(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1603,14 +2017,14 @@ func awsAwsquery_deserializeOpErrorReceiveMessage(response *smithyhttp.Response, } } -type awsAwsquery_deserializeOpRemovePermission struct { +type awsAwsjson10_deserializeOpRemovePermission struct { } -func (*awsAwsquery_deserializeOpRemovePermission) ID() string { +func (*awsAwsjson10_deserializeOpRemovePermission) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpRemovePermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpRemovePermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1624,7 +2038,7 @@ func (m *awsAwsquery_deserializeOpRemovePermission) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorRemovePermission(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorRemovePermission(response, &metadata) } output := &RemovePermissionOutput{} out.Result = output @@ -1638,7 +2052,7 @@ func (m *awsAwsquery_deserializeOpRemovePermission) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsquery_deserializeOpErrorRemovePermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorRemovePermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1648,22 +2062,57 @@ func awsAwsquery_deserializeOpErrorRemovePermission(response *smithyhttp.Respons errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1673,14 +2122,14 @@ func awsAwsquery_deserializeOpErrorRemovePermission(response *smithyhttp.Respons } } -type awsAwsquery_deserializeOpSendMessage struct { +type awsAwsjson10_deserializeOpSendMessage struct { } -func (*awsAwsquery_deserializeOpSendMessage) ID() string { +func (*awsAwsjson10_deserializeOpSendMessage) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSendMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpSendMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1694,31 +2143,19 @@ func (m *awsAwsquery_deserializeOpSendMessage) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSendMessage(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorSendMessage(response, &metadata) } output := &SendMessageOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("SendMessageResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1728,8 +2165,7 @@ func (m *awsAwsquery_deserializeOpSendMessage) HandleDeserialize(ctx context.Con return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentSendMessageOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentSendMessageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1743,7 +2179,7 @@ func (m *awsAwsquery_deserializeOpSendMessage) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsquery_deserializeOpErrorSendMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorSendMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1753,28 +2189,81 @@ func awsAwsquery_deserializeOpErrorSendMessage(response *smithyhttp.Response, me errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.UnsupportedOperation", errorCode): - return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) case strings.EqualFold("InvalidMessageContents", errorCode): - return awsAwsquery_deserializeErrorInvalidMessageContents(response, errorBody) + return awsAwsjson10_deserializeErrorInvalidMessageContents(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("KmsAccessDenied", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDenied(response, errorBody) + + case strings.EqualFold("KmsDisabled", errorCode): + return awsAwsjson10_deserializeErrorKmsDisabled(response, errorBody) + + case strings.EqualFold("KmsInvalidKeyUsage", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidKeyUsage(response, errorBody) + + case strings.EqualFold("KmsInvalidState", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidState(response, errorBody) + + case strings.EqualFold("KmsNotFound", errorCode): + return awsAwsjson10_deserializeErrorKmsNotFound(response, errorBody) + + case strings.EqualFold("KmsOptInRequired", errorCode): + return awsAwsjson10_deserializeErrorKmsOptInRequired(response, errorBody) + + case strings.EqualFold("KmsThrottled", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottled(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1784,14 +2273,14 @@ func awsAwsquery_deserializeOpErrorSendMessage(response *smithyhttp.Response, me } } -type awsAwsquery_deserializeOpSendMessageBatch struct { +type awsAwsjson10_deserializeOpSendMessageBatch struct { } -func (*awsAwsquery_deserializeOpSendMessageBatch) ID() string { +func (*awsAwsjson10_deserializeOpSendMessageBatch) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSendMessageBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpSendMessageBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1805,31 +2294,19 @@ func (m *awsAwsquery_deserializeOpSendMessageBatch) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSendMessageBatch(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorSendMessageBatch(response, &metadata) } output := &SendMessageBatchOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("SendMessageBatchResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -1839,8 +2316,7 @@ func (m *awsAwsquery_deserializeOpSendMessageBatch) HandleDeserialize(ctx contex return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentSendMessageBatchOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentSendMessageBatchOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1854,7 +2330,7 @@ func (m *awsAwsquery_deserializeOpSendMessageBatch) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsquery_deserializeOpErrorSendMessageBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorSendMessageBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1864,40 +2340,93 @@ func awsAwsquery_deserializeOpErrorSendMessageBatch(response *smithyhttp.Respons errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.BatchEntryIdsNotDistinct", errorCode): - return awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) + case strings.EqualFold("BatchEntryIdsNotDistinct", errorCode): + return awsAwsjson10_deserializeErrorBatchEntryIdsNotDistinct(response, errorBody) + + case strings.EqualFold("BatchRequestTooLong", errorCode): + return awsAwsjson10_deserializeErrorBatchRequestTooLong(response, errorBody) + + case strings.EqualFold("EmptyBatchRequest", errorCode): + return awsAwsjson10_deserializeErrorEmptyBatchRequest(response, errorBody) + + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidBatchEntryId", errorCode): + return awsAwsjson10_deserializeErrorInvalidBatchEntryId(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("KmsAccessDenied", errorCode): + return awsAwsjson10_deserializeErrorKmsAccessDenied(response, errorBody) + + case strings.EqualFold("KmsDisabled", errorCode): + return awsAwsjson10_deserializeErrorKmsDisabled(response, errorBody) + + case strings.EqualFold("KmsInvalidKeyUsage", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidKeyUsage(response, errorBody) + + case strings.EqualFold("KmsInvalidState", errorCode): + return awsAwsjson10_deserializeErrorKmsInvalidState(response, errorBody) + + case strings.EqualFold("KmsNotFound", errorCode): + return awsAwsjson10_deserializeErrorKmsNotFound(response, errorBody) + + case strings.EqualFold("KmsOptInRequired", errorCode): + return awsAwsjson10_deserializeErrorKmsOptInRequired(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.BatchRequestTooLong", errorCode): - return awsAwsquery_deserializeErrorBatchRequestTooLong(response, errorBody) + case strings.EqualFold("KmsThrottled", errorCode): + return awsAwsjson10_deserializeErrorKmsThrottled(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.EmptyBatchRequest", errorCode): - return awsAwsquery_deserializeErrorEmptyBatchRequest(response, errorBody) + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.InvalidBatchEntryId", errorCode): - return awsAwsquery_deserializeErrorInvalidBatchEntryId(response, errorBody) + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.TooManyEntriesInBatchRequest", errorCode): - return awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) + case strings.EqualFold("TooManyEntriesInBatchRequest", errorCode): + return awsAwsjson10_deserializeErrorTooManyEntriesInBatchRequest(response, errorBody) - case strings.EqualFold("AWS.SimpleQueueService.UnsupportedOperation", errorCode): - return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1907,14 +2436,14 @@ func awsAwsquery_deserializeOpErrorSendMessageBatch(response *smithyhttp.Respons } } -type awsAwsquery_deserializeOpSetQueueAttributes struct { +type awsAwsjson10_deserializeOpSetQueueAttributes struct { } -func (*awsAwsquery_deserializeOpSetQueueAttributes) ID() string { +func (*awsAwsjson10_deserializeOpSetQueueAttributes) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpSetQueueAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpSetQueueAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1928,7 +2457,7 @@ func (m *awsAwsquery_deserializeOpSetQueueAttributes) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorSetQueueAttributes(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorSetQueueAttributes(response, &metadata) } output := &SetQueueAttributesOutput{} out.Result = output @@ -1942,7 +2471,7 @@ func (m *awsAwsquery_deserializeOpSetQueueAttributes) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorSetQueueAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorSetQueueAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1952,25 +2481,66 @@ func awsAwsquery_deserializeOpErrorSetQueueAttributes(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + case strings.EqualFold("InvalidAttributeName", errorCode): - return awsAwsquery_deserializeErrorInvalidAttributeName(response, errorBody) + return awsAwsjson10_deserializeErrorInvalidAttributeName(response, errorBody) + + case strings.EqualFold("InvalidAttributeValue", errorCode): + return awsAwsjson10_deserializeErrorInvalidAttributeValue(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("OverLimit", errorCode): + return awsAwsjson10_deserializeErrorOverLimit(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -1980,14 +2550,14 @@ func awsAwsquery_deserializeOpErrorSetQueueAttributes(response *smithyhttp.Respo } } -type awsAwsquery_deserializeOpStartMessageMoveTask struct { +type awsAwsjson10_deserializeOpStartMessageMoveTask struct { } -func (*awsAwsquery_deserializeOpStartMessageMoveTask) ID() string { +func (*awsAwsjson10_deserializeOpStartMessageMoveTask) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpStartMessageMoveTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpStartMessageMoveTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2001,31 +2571,19 @@ func (m *awsAwsquery_deserializeOpStartMessageMoveTask) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorStartMessageMoveTask(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorStartMessageMoveTask(response, &metadata) } output := &StartMessageMoveTaskOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("StartMessageMoveTaskResult") - if err != nil { + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -2035,8 +2593,7 @@ func (m *awsAwsquery_deserializeOpStartMessageMoveTask) HandleDeserialize(ctx co return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeOpDocumentStartMessageMoveTaskOutput(&output, decoder) + err = awsAwsjson10_deserializeOpDocumentStartMessageMoveTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2050,7 +2607,7 @@ func (m *awsAwsquery_deserializeOpStartMessageMoveTask) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsquery_deserializeOpErrorStartMessageMoveTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorStartMessageMoveTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2060,28 +2617,57 @@ func awsAwsquery_deserializeOpErrorStartMessageMoveTask(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { - case strings.EqualFold("AWS.SimpleQueueService.UnsupportedOperation", errorCode): - return awsAwsquery_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsquery_deserializeErrorResourceNotFoundException(response, errorBody) + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -2091,14 +2677,14 @@ func awsAwsquery_deserializeOpErrorStartMessageMoveTask(response *smithyhttp.Res } } -type awsAwsquery_deserializeOpTagQueue struct { +type awsAwsjson10_deserializeOpTagQueue struct { } -func (*awsAwsquery_deserializeOpTagQueue) ID() string { +func (*awsAwsjson10_deserializeOpTagQueue) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpTagQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpTagQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2112,7 +2698,7 @@ func (m *awsAwsquery_deserializeOpTagQueue) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorTagQueue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorTagQueue(response, &metadata) } output := &TagQueueOutput{} out.Result = output @@ -2126,7 +2712,7 @@ func (m *awsAwsquery_deserializeOpTagQueue) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsAwsquery_deserializeOpErrorTagQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorTagQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2136,22 +2722,57 @@ func awsAwsquery_deserializeOpErrorTagQueue(response *smithyhttp.Response, metad errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -2161,14 +2782,14 @@ func awsAwsquery_deserializeOpErrorTagQueue(response *smithyhttp.Response, metad } } -type awsAwsquery_deserializeOpUntagQueue struct { +type awsAwsjson10_deserializeOpUntagQueue struct { } -func (*awsAwsquery_deserializeOpUntagQueue) ID() string { +func (*awsAwsjson10_deserializeOpUntagQueue) ID() string { return "OperationDeserializer" } -func (m *awsAwsquery_deserializeOpUntagQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUntagQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2182,7 +2803,7 @@ func (m *awsAwsquery_deserializeOpUntagQueue) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsquery_deserializeOpErrorUntagQueue(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUntagQueue(response, &metadata) } output := &UntagQueueOutput{} out.Result = output @@ -2196,7 +2817,7 @@ func (m *awsAwsquery_deserializeOpUntagQueue) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsquery_deserializeOpErrorUntagQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUntagQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2206,22 +2827,57 @@ func awsAwsquery_deserializeOpErrorUntagQueue(response *smithyhttp.Response, met errorCode := "UnknownError" errorMessage := errorCode - errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } return err } - if reqID := errorComponents.RequestID; len(reqID) != 0 { - awsmiddleware.SetRequestIDMetadata(metadata, reqID) - } - if len(errorComponents.Code) != 0 { - errorCode = errorComponents.Code + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } - if len(errorComponents.Message) != 0 { - errorMessage = errorComponents.Message + if len(message) != 0 { + errorMessage = message } - errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAddress", errorCode): + return awsAwsjson10_deserializeErrorInvalidAddress(response, errorBody) + + case strings.EqualFold("InvalidSecurity", errorCode): + return awsAwsjson10_deserializeErrorInvalidSecurity(response, errorBody) + + case strings.EqualFold("QueueDoesNotExist", errorCode): + return awsAwsjson10_deserializeErrorQueueDoesNotExist(response, errorBody) + + case strings.EqualFold("RequestThrottled", errorCode): + return awsAwsjson10_deserializeErrorRequestThrottled(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsAwsjson10_deserializeErrorUnsupportedOperation(response, errorBody) + default: + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + errorCode = awsQueryErrorCode + } genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, @@ -2231,95 +2887,1111 @@ func awsAwsquery_deserializeOpErrorUntagQueue(response *smithyhttp.Response, met } } -func awsAwsquery_deserializeErrorBatchEntryIdsNotDistinct(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.BatchEntryIdsNotDistinct{} - return output -} - -func awsAwsquery_deserializeErrorBatchRequestTooLong(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.BatchRequestTooLong{} - return output -} +func awsAwsjson10_deserializeErrorBatchEntryIdsNotDistinct(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsAwsquery_deserializeErrorEmptyBatchRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.EmptyBatchRequest{} - return output -} + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } -func awsAwsquery_deserializeErrorInvalidAttributeName(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidAttributeName{} - return output -} + output := &types.BatchEntryIdsNotDistinct{} + err := awsAwsjson10_deserializeDocumentBatchEntryIdsNotDistinct(&output, shape) -func awsAwsquery_deserializeErrorInvalidBatchEntryId(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidBatchEntryId{} - return output -} + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } -func awsAwsquery_deserializeErrorInvalidIdFormat(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidIdFormat{} + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorInvalidMessageContents(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidMessageContents{} - return output -} +func awsAwsjson10_deserializeErrorBatchRequestTooLong(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsAwsquery_deserializeErrorMessageNotInflight(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.MessageNotInflight{} - return output -} + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } -func awsAwsquery_deserializeErrorOverLimit(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.OverLimit{} - return output -} + output := &types.BatchRequestTooLong{} + err := awsAwsjson10_deserializeDocumentBatchRequestTooLong(&output, shape) -func awsAwsquery_deserializeErrorPurgeQueueInProgress(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PurgeQueueInProgress{} - return output -} + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } -func awsAwsquery_deserializeErrorQueueDeletedRecently(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.QueueDeletedRecently{} + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorQueueDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeErrorEmptyBatchRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.EmptyBatchRequest{} + err := awsAwsjson10_deserializeDocumentEmptyBatchRequest(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidAddress(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidAddress{} + err := awsAwsjson10_deserializeDocumentInvalidAddress(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidAttributeName(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidAttributeName{} + err := awsAwsjson10_deserializeDocumentInvalidAttributeName(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidAttributeValue(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidAttributeValue{} + err := awsAwsjson10_deserializeDocumentInvalidAttributeValue(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidBatchEntryId(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidBatchEntryId{} + err := awsAwsjson10_deserializeDocumentInvalidBatchEntryId(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidIdFormat(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidIdFormat{} + err := awsAwsjson10_deserializeDocumentInvalidIdFormat(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidMessageContents(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidMessageContents{} + err := awsAwsjson10_deserializeDocumentInvalidMessageContents(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorInvalidSecurity(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidSecurity{} + err := awsAwsjson10_deserializeDocumentInvalidSecurity(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsAccessDenied(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsAccessDenied{} + err := awsAwsjson10_deserializeDocumentKmsAccessDenied(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsDisabled(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsDisabled{} + err := awsAwsjson10_deserializeDocumentKmsDisabled(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsInvalidKeyUsage(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsInvalidKeyUsage{} + err := awsAwsjson10_deserializeDocumentKmsInvalidKeyUsage(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsInvalidState(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsInvalidState{} + err := awsAwsjson10_deserializeDocumentKmsInvalidState(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsNotFound{} + err := awsAwsjson10_deserializeDocumentKmsNotFound(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsOptInRequired(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsOptInRequired{} + err := awsAwsjson10_deserializeDocumentKmsOptInRequired(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorKmsThrottled(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.KmsThrottled{} + err := awsAwsjson10_deserializeDocumentKmsThrottled(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorMessageNotInflight(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.MessageNotInflight{} + err := awsAwsjson10_deserializeDocumentMessageNotInflight(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorOverLimit(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OverLimit{} + err := awsAwsjson10_deserializeDocumentOverLimit(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorPurgeQueueInProgress(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.PurgeQueueInProgress{} + err := awsAwsjson10_deserializeDocumentPurgeQueueInProgress(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorQueueDeletedRecently(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.QueueDeletedRecently{} + err := awsAwsjson10_deserializeDocumentQueueDeletedRecently(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorQueueDoesNotExist(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + output := &types.QueueDoesNotExist{} + err := awsAwsjson10_deserializeDocumentQueueDoesNotExist(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorQueueNameExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeErrorQueueNameExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + output := &types.QueueNameExists{} + err := awsAwsjson10_deserializeDocumentQueueNameExists(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorReceiptHandleIsInvalid(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeErrorReceiptHandleIsInvalid(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + output := &types.ReceiptHandleIsInvalid{} + err := awsAwsjson10_deserializeDocumentReceiptHandleIsInvalid(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } + return output +} + +func awsAwsjson10_deserializeErrorRequestThrottled(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.RequestThrottled{} + err := awsAwsjson10_deserializeDocumentRequestThrottled(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + output := &types.ResourceNotFoundException{} + err := awsAwsjson10_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorTooManyEntriesInBatchRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeErrorTooManyEntriesInBatchRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + output := &types.TooManyEntriesInBatchRequest{} + err := awsAwsjson10_deserializeDocumentTooManyEntriesInBatchRequest(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeErrorUnsupportedOperation(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson10_deserializeErrorUnsupportedOperation(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + output := &types.UnsupportedOperation{} + err := awsAwsjson10_deserializeDocumentUnsupportedOperation(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + awsQueryErrorCode := getAwsQueryErrorCode(response) + if awsQueryErrorCode != "" { + output.ErrorCodeOverride = &awsQueryErrorCode + } return output } -func awsAwsquery_deserializeDocumentBatchEntryIdsNotDistinct(v **types.BatchEntryIdsNotDistinct, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentBatchEntryIdsNotDistinct(v **types.BatchEntryIdsNotDistinct, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.BatchEntryIdsNotDistinct if *v == nil { sv = &types.BatchEntryIdsNotDistinct{} @@ -2327,35 +3999,39 @@ func awsAwsquery_deserializeDocumentBatchEntryIdsNotDistinct(v **types.BatchEntr sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentBatchRequestTooLong(v **types.BatchRequestTooLong, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentBatchRequestTooLong(v **types.BatchRequestTooLong, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.BatchRequestTooLong if *v == nil { sv = &types.BatchRequestTooLong{} @@ -2363,35 +4039,39 @@ func awsAwsquery_deserializeDocumentBatchRequestTooLong(v **types.BatchRequestTo sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentBatchResultErrorEntry(v **types.BatchResultErrorEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentBatchResultErrorEntry(v **types.BatchResultErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.BatchResultErrorEntry if *v == nil { sv = &types.BatchResultErrorEntry{} @@ -2399,662 +4079,879 @@ func awsAwsquery_deserializeDocumentBatchResultErrorEntry(v **types.BatchResultE sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Code", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Code = ptr.String(xtv) + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) } - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } - case strings.EqualFold("Message", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } - case strings.EqualFold("SenderFault", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + case "SenderFault": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.SenderFault = xtv + sv.SenderFault = jtv } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentBatchResultErrorEntryList(v *[]types.BatchResultErrorEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentBatchResultErrorEntryList(v *[]types.BatchResultErrorEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.BatchResultErrorEntry + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.BatchResultErrorEntry if *v == nil { - sv = make([]types.BatchResultErrorEntry, 0) + cv = []types.BatchResultErrorEntry{} } else { - sv = *v + cv = *v } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { + for _, value := range shape { + var col types.BatchResultErrorEntry + destAddr := &col + if err := awsAwsjson10_deserializeDocumentBatchResultErrorEntry(&destAddr, value); err != nil { return err } - if done { - break + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentBinaryList(v *[][]byte, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv [][]byte + if *v == nil { + cv = [][]byte{} + } else { + cv = *v + } + + for _, value := range shape { + var col []byte + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Binary to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode Binary, %w", err) + } + col = dv } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.BatchResultErrorEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentBatchResultErrorEntry(&destAddr, nodeDecoder); err != nil { - return err + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentChangeMessageVisibilityBatchResultEntry(v **types.ChangeMessageVisibilityBatchResultEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ChangeMessageVisibilityBatchResultEntry + if *v == nil { + sv = &types.ChangeMessageVisibilityBatchResultEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } - col = *destAddr - sv = append(sv, col) default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(v *[]types.BatchResultErrorEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.BatchResultErrorEntry +func awsAwsjson10_deserializeDocumentChangeMessageVisibilityBatchResultEntryList(v *[]types.ChangeMessageVisibilityBatchResultEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ChangeMessageVisibilityBatchResultEntry if *v == nil { - sv = make([]types.BatchResultErrorEntry, 0) + cv = []types.ChangeMessageVisibilityBatchResultEntry{} } else { - sv = *v + cv = *v } - switch { - default: - var mv types.BatchResultErrorEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentBatchResultErrorEntry(&destAddr, nodeDecoder); err != nil { + for _, value := range shape { + var col types.ChangeMessageVisibilityBatchResultEntry + destAddr := &col + if err := awsAwsjson10_deserializeDocumentChangeMessageVisibilityBatchResultEntry(&destAddr, value); err != nil { return err } - mv = *destAddr - sv = append(sv, mv) + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsquery_deserializeDocumentBinaryList(v *[][]byte, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentDeleteMessageBatchResultEntry(v **types.DeleteMessageBatchResultEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv [][]byte + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeleteMessageBatchResultEntry if *v == nil { - sv = make([][]byte, 0) + sv = &types.DeleteMessageBatchResultEntry{} } else { sv = *v } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + } - if done { - break + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDeleteMessageBatchResultEntryList(v *[]types.DeleteMessageBatchResultEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.DeleteMessageBatchResultEntry + if *v == nil { + cv = []types.DeleteMessageBatchResultEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeleteMessageBatchResultEntry + destAddr := &col + if err := awsAwsjson10_deserializeDocumentDeleteMessageBatchResultEntry(&destAddr, value); err != nil { + return err } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("BinaryListValue", t.Name.Local): - var col []byte - var data string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - data = xtv - } - col, err = base64.StdEncoding.DecodeString(data) - if err != nil { - return err + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentEmptyBatchRequest(v **types.EmptyBatchRequest, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EmptyBatchRequest + if *v == nil { + sv = &types.EmptyBatchRequest{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } - sv = append(sv, col) default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentBinaryListUnwrapped(v *[][]byte, decoder smithyxml.NodeDecoder) error { - var sv [][]byte +func awsAwsjson10_deserializeDocumentInvalidAddress(v **types.InvalidAddress, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidAddress if *v == nil { - sv = make([][]byte, 0) + sv = &types.InvalidAddress{} } else { sv = *v } - switch { - default: - var mv []byte - t := decoder.StartEl - _ = t - var data string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } - { - xtv := string(val) - data = xtv + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInvalidAttributeName(v **types.InvalidAttributeName, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidAttributeName + if *v == nil { + sv = &types.InvalidAttributeName{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } - mv, err = base64.StdEncoding.DecodeString(data) - if err != nil { - return err + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentInvalidAttributeValue(v **types.InvalidAttributeValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidAttributeValue + if *v == nil { + sv = &types.InvalidAttributeValue{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } - sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntry(v **types.ChangeMessageVisibilityBatchResultEntry, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentInvalidBatchEntryId(v **types.InvalidBatchEntryId, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ChangeMessageVisibilityBatchResultEntry + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidBatchEntryId if *v == nil { - sv = &types.ChangeMessageVisibilityBatchResultEntry{} + sv = &types.InvalidBatchEntryId{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntryList(v *[]types.ChangeMessageVisibilityBatchResultEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentInvalidIdFormat(v **types.InvalidIdFormat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.ChangeMessageVisibilityBatchResultEntry + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidIdFormat if *v == nil { - sv = make([]types.ChangeMessageVisibilityBatchResultEntry, 0) + sv = &types.InvalidIdFormat{} } else { sv = *v } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.ChangeMessageVisibilityBatchResultEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - + for key, value := range shape { + switch key { default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntryListUnwrapped(v *[]types.ChangeMessageVisibilityBatchResultEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.ChangeMessageVisibilityBatchResultEntry +func awsAwsjson10_deserializeDocumentInvalidMessageContents(v **types.InvalidMessageContents, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidMessageContents if *v == nil { - sv = make([]types.ChangeMessageVisibilityBatchResultEntry, 0) + sv = &types.InvalidMessageContents{} } else { sv = *v } - switch { - default: - var mv types.ChangeMessageVisibilityBatchResultEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntry(&destAddr, nodeDecoder); err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } - mv = *destAddr - sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntry(v **types.DeleteMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentInvalidSecurity(v **types.InvalidSecurity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DeleteMessageBatchResultEntry + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidSecurity if *v == nil { - sv = &types.DeleteMessageBatchResultEntry{} + sv = &types.InvalidSecurity{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntryList(v *[]types.DeleteMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentKmsAccessDenied(v **types.KmsAccessDenied, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.DeleteMessageBatchResultEntry + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsAccessDenied if *v == nil { - sv = make([]types.DeleteMessageBatchResultEntry, 0) + sv = &types.KmsAccessDenied{} } else { sv = *v } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.DeleteMessageBatchResultEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntry(&destAddr, nodeDecoder); err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } - col = *destAddr - sv = append(sv, col) default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntryListUnwrapped(v *[]types.DeleteMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.DeleteMessageBatchResultEntry +func awsAwsjson10_deserializeDocumentKmsDisabled(v **types.KmsDisabled, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsDisabled if *v == nil { - sv = make([]types.DeleteMessageBatchResultEntry, 0) + sv = &types.KmsDisabled{} } else { sv = *v } - switch { - default: - var mv types.DeleteMessageBatchResultEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntry(&destAddr, nodeDecoder); err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } - mv = *destAddr - sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentEmptyBatchRequest(v **types.EmptyBatchRequest, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentKmsInvalidKeyUsage(v **types.KmsInvalidKeyUsage, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.EmptyBatchRequest + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsInvalidKeyUsage if *v == nil { - sv = &types.EmptyBatchRequest{} + sv = &types.KmsInvalidKeyUsage{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentInvalidAttributeName(v **types.InvalidAttributeName, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentKmsInvalidState(v **types.KmsInvalidState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidAttributeName + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsInvalidState if *v == nil { - sv = &types.InvalidAttributeName{} + sv = &types.KmsInvalidState{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentInvalidBatchEntryId(v **types.InvalidBatchEntryId, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentKmsNotFound(v **types.KmsNotFound, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidBatchEntryId + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsNotFound if *v == nil { - sv = &types.InvalidBatchEntryId{} + sv = &types.KmsNotFound{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentInvalidIdFormat(v **types.InvalidIdFormat, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentKmsOptInRequired(v **types.KmsOptInRequired, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidIdFormat + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsOptInRequired if *v == nil { - sv = &types.InvalidIdFormat{} + sv = &types.KmsOptInRequired{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentInvalidMessageContents(v **types.InvalidMessageContents, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentKmsThrottled(v **types.KmsThrottled, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidMessageContents + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.KmsThrottled if *v == nil { - sv = &types.InvalidMessageContents{} + sv = &types.KmsThrottled{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(v **types.ListMessageMoveTasksResultEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentListMessageMoveTasksResultEntry(v **types.ListMessageMoveTasksResultEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.ListMessageMoveTasksResultEntry if *v == nil { sv = &types.ListMessageMoveTasksResultEntry{} @@ -3062,236 +4959,161 @@ func awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(v **types.Li sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ApproximateNumberOfMessagesMoved", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + for key, value := range shape { + switch key { + case "ApproximateNumberOfMessagesMoved": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() if err != nil { return err } sv.ApproximateNumberOfMessagesMoved = i64 } - case strings.EqualFold("ApproximateNumberOfMessagesToMove", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + case "ApproximateNumberOfMessagesToMove": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NullableLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() if err != nil { return err } - sv.ApproximateNumberOfMessagesToMove = i64 + sv.ApproximateNumberOfMessagesToMove = ptr.Int64(i64) } - case strings.EqualFold("DestinationArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DestinationArn = ptr.String(xtv) + case "DestinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DestinationArn = ptr.String(jtv) } - case strings.EqualFold("FailureReason", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FailureReason = ptr.String(xtv) + case "FailureReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FailureReason = ptr.String(jtv) } - case strings.EqualFold("MaxNumberOfMessagesPerSecond", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + case "MaxNumberOfMessagesPerSecond": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NullableInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() if err != nil { return err } - sv.MaxNumberOfMessagesPerSecond = int32(i64) + sv.MaxNumberOfMessagesPerSecond = ptr.Int32(int32(i64)) } - case strings.EqualFold("SourceArn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SourceArn = ptr.String(xtv) + case "SourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SourceArn = ptr.String(jtv) } - case strings.EqualFold("StartedTimestamp", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + case "StartedTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() if err != nil { return err } sv.StartedTimestamp = i64 } - case strings.EqualFold("Status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = ptr.String(xtv) + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskStatus to be of type string, got %T instead", value) + } + sv.Status = types.TaskStatus(jtv) } - case strings.EqualFold("TaskHandle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TaskHandle = ptr.String(xtv) + case "TaskHandle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TaskHandle = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntryList(v *[]types.ListMessageMoveTasksResultEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentListMessageMoveTasksResultEntryList(v *[]types.ListMessageMoveTasksResultEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.ListMessageMoveTasksResultEntry - if *v == nil { - sv = make([]types.ListMessageMoveTasksResultEntry, 0) - } else { - sv = *v + if value == nil { + return nil } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.ListMessageMoveTasksResultEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } -func awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntryListUnwrapped(v *[]types.ListMessageMoveTasksResultEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.ListMessageMoveTasksResultEntry + var cv []types.ListMessageMoveTasksResultEntry if *v == nil { - sv = make([]types.ListMessageMoveTasksResultEntry, 0) + cv = []types.ListMessageMoveTasksResultEntry{} } else { - sv = *v + cv = *v } - switch { - default: - var mv types.ListMessageMoveTasksResultEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntry(&destAddr, nodeDecoder); err != nil { + for _, value := range shape { + var col types.ListMessageMoveTasksResultEntry + destAddr := &col + if err := awsAwsjson10_deserializeDocumentListMessageMoveTasksResultEntry(&destAddr, value); err != nil { return err } - mv = *destAddr - sv = append(sv, mv) + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsquery_deserializeDocumentMessage(v **types.Message, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentMessage(v **types.Message, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.Message if *v == nil { sv = &types.Message{} @@ -3299,112 +5121,85 @@ func awsAwsquery_deserializeDocumentMessage(v **types.Message, decoder smithyxml sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Attribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentMessageSystemAttributeMapUnwrapped(&sv.Attributes, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Attributes": + if err := awsAwsjson10_deserializeDocumentMessageSystemAttributeMap(&sv.Attributes, value); err != nil { return err } - case strings.EqualFold("Body", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Body = ptr.String(xtv) + case "Body": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Body = ptr.String(jtv) } - case strings.EqualFold("MD5OfBody", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfBody = ptr.String(xtv) + case "MD5OfBody": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfBody = ptr.String(jtv) } - case strings.EqualFold("MD5OfMessageAttributes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageAttributes = ptr.String(xtv) + case "MD5OfMessageAttributes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageAttributes = ptr.String(jtv) } - case strings.EqualFold("MessageAttribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentMessageBodyAttributeMapUnwrapped(&sv.MessageAttributes, nodeDecoder); err != nil { + case "MessageAttributes": + if err := awsAwsjson10_deserializeDocumentMessageBodyAttributeMap(&sv.MessageAttributes, value); err != nil { return err } - case strings.EqualFold("MessageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MessageId = ptr.String(xtv) + case "MessageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MessageId = ptr.String(jtv) } - case strings.EqualFold("ReceiptHandle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ReceiptHandle = ptr.String(xtv) + case "ReceiptHandle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReceiptHandle = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentMessageAttributeValue(v **types.MessageAttributeValue, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentMessageAttributeValue(v **types.MessageAttributeValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.MessageAttributeValue if *v == nil { sv = &types.MessageAttributeValue{} @@ -3412,253 +5207,140 @@ func awsAwsquery_deserializeDocumentMessageAttributeValue(v **types.MessageAttri sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("BinaryListValue", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentBinaryListUnwrapped(&sv.BinaryListValues, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "BinaryListValues": + if err := awsAwsjson10_deserializeDocumentBinaryList(&sv.BinaryListValues, value); err != nil { return err } - case strings.EqualFold("BinaryValue", t.Name.Local): - var data string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - data = xtv - } - sv.BinaryValue, err = base64.StdEncoding.DecodeString(data) - if err != nil { - return err + case "BinaryValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Binary to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode Binary, %w", err) + } + sv.BinaryValue = dv } - case strings.EqualFold("DataType", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DataType = ptr.String(xtv) + case "DataType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DataType = ptr.String(jtv) } - case strings.EqualFold("StringListValue", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentStringListUnwrapped(&sv.StringListValues, nodeDecoder); err != nil { + case "StringListValues": + if err := awsAwsjson10_deserializeDocumentStringList(&sv.StringListValues, value); err != nil { return err } - case strings.EqualFold("StringValue", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.StringValue = ptr.String(xtv) + case "StringValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StringValue = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentMessageBodyAttributeMap(v *map[string]types.MessageAttributeValue, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentMessageBodyAttributeMap(v *map[string]types.MessageAttributeValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv map[string]types.MessageAttributeValue - if *v == nil { - sv = make(map[string]types.MessageAttributeValue, 0) - } else { - sv = *v + if value == nil { + return nil } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("entry", t.Name.Local): - entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentMessageBodyAttributeMapUnwrapped(&sv, entryDecoder); err != nil { - return err - } - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentMessageBodyAttributeMapUnwrapped(v *map[string]types.MessageAttributeValue, decoder smithyxml.NodeDecoder) error { - var sv map[string]types.MessageAttributeValue + var mv map[string]types.MessageAttributeValue if *v == nil { - sv = make(map[string]types.MessageAttributeValue, 0) + mv = map[string]types.MessageAttributeValue{} } else { - sv = *v + mv = *v } - var ek string - var ev types.MessageAttributeValue - for { - t, done, err := decoder.Token() - if err != nil { + for key, value := range shape { + var parsedVal types.MessageAttributeValue + mapVar := parsedVal + destAddr := &mapVar + if err := awsAwsjson10_deserializeDocumentMessageAttributeValue(&destAddr, value); err != nil { return err } - if done { - sv[ek] = ev - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ek = xtv - } - - case strings.EqualFold("Value", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - mapVar := ev - destAddr := &mapVar - if err := awsAwsquery_deserializeDocumentMessageAttributeValue(&destAddr, nodeDecoder); err != nil { - return err - } - ev = *destAddr - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + parsedVal = *destAddr + mv[key] = parsedVal - } - decoder = originalDecoder } - *v = sv + *v = mv return nil } -func awsAwsquery_deserializeDocumentMessageList(v *[]types.Message, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentMessageList(v *[]types.Message, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Message - if *v == nil { - sv = make([]types.Message, 0) - } else { - sv = *v + if value == nil { + return nil } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.Message - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentMessage(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentMessageListUnwrapped(v *[]types.Message, decoder smithyxml.NodeDecoder) error { - var sv []types.Message + var cv []types.Message if *v == nil { - sv = make([]types.Message, 0) + cv = []types.Message{} } else { - sv = *v + cv = *v } - switch { - default: - var mv types.Message - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentMessage(&destAddr, nodeDecoder); err != nil { + for _, value := range shape { + var col types.Message + destAddr := &col + if err := awsAwsjson10_deserializeDocumentMessage(&destAddr, value); err != nil { return err } - mv = *destAddr - sv = append(sv, mv) + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsquery_deserializeDocumentMessageNotInflight(v **types.MessageNotInflight, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentMessageNotInflight(v **types.MessageNotInflight, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.MessageNotInflight if *v == nil { sv = &types.MessageNotInflight{} @@ -3666,133 +5348,66 @@ func awsAwsquery_deserializeDocumentMessageNotInflight(v **types.MessageNotInfli sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { + for key, value := range shape { + switch key { default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentMessageSystemAttributeMap(v *map[string]string, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentMessageSystemAttributeMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv map[string]string - if *v == nil { - sv = make(map[string]string, 0) - } else { - sv = *v + if value == nil { + return nil } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("entry", t.Name.Local): - entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentMessageSystemAttributeMapUnwrapped(&sv, entryDecoder); err != nil { - return err - } - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentMessageSystemAttributeMapUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { - var sv map[string]string + var mv map[string]string if *v == nil { - sv = make(map[string]string, 0) + mv = map[string]string{} } else { - sv = *v + mv = *v } - var ek types.MessageSystemAttributeName - var ev string - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - sv[string(ek)] = ev - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ek = types.MessageSystemAttributeName(xtv) - } - - case strings.EqualFold("Value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ev = xtv - } - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - + parsedVal = jtv } - decoder = originalDecoder + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsAwsquery_deserializeDocumentOverLimit(v **types.OverLimit, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentOverLimit(v **types.OverLimit, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.OverLimit if *v == nil { sv = &types.OverLimit{} @@ -3800,98 +5415,59 @@ func awsAwsquery_deserializeDocumentOverLimit(v **types.OverLimit, decoder smith sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentPurgeQueueInProgress(v **types.PurgeQueueInProgress, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentPurgeQueueInProgress(v **types.PurgeQueueInProgress, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.PurgeQueueInProgress - if *v == nil { - sv = &types.PurgeQueueInProgress{} - } else { - sv = *v + if value == nil { + return nil } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentQueueAttributeMap(v *map[string]string, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv map[string]string + var sv *types.PurgeQueueInProgress if *v == nil { - sv = make(map[string]string, 0) + sv = &types.PurgeQueueInProgress{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("entry", t.Name.Local): - entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentQueueAttributeMapUnwrapped(&sv, entryDecoder); err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } } @@ -3899,70 +5475,55 @@ func awsAwsquery_deserializeDocumentQueueAttributeMap(v *map[string]string, deco return nil } -func awsAwsquery_deserializeDocumentQueueAttributeMapUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { - var sv map[string]string - if *v == nil { - sv = make(map[string]string, 0) - } else { - sv = *v +func awsAwsjson10_deserializeDocumentQueueAttributeMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - var ek types.QueueAttributeName - var ev string - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - sv[string(ek)] = ev - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ek = types.QueueAttributeName(xtv) - } - - case strings.EqualFold("Value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ev = xtv - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv } - decoder = originalDecoder + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsAwsquery_deserializeDocumentQueueDeletedRecently(v **types.QueueDeletedRecently, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentQueueDeletedRecently(v **types.QueueDeletedRecently, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.QueueDeletedRecently if *v == nil { sv = &types.QueueDeletedRecently{} @@ -3970,35 +5531,39 @@ func awsAwsquery_deserializeDocumentQueueDeletedRecently(v **types.QueueDeletedR sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentQueueDoesNotExist(v **types.QueueDoesNotExist, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentQueueDoesNotExist(v **types.QueueDoesNotExist, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.QueueDoesNotExist if *v == nil { sv = &types.QueueDoesNotExist{} @@ -4006,35 +5571,39 @@ func awsAwsquery_deserializeDocumentQueueDoesNotExist(v **types.QueueDoesNotExis sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentQueueNameExists(v **types.QueueNameExists, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentQueueNameExists(v **types.QueueNameExists, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.QueueNameExists if *v == nil { sv = &types.QueueNameExists{} @@ -4042,151 +5611,155 @@ func awsAwsquery_deserializeDocumentQueueNameExists(v **types.QueueNameExists, d sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentQueueUrlList(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentQueueUrlList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string if *v == nil { - sv = make([]string, 0) + cv = []string{} } else { - sv = *v + cv = *v } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("member", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - + col = jtv } - decoder = originalDecoder + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsquery_deserializeDocumentQueueUrlListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string +func awsAwsjson10_deserializeDocumentReceiptHandleIsInvalid(v **types.ReceiptHandleIsInvalid, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReceiptHandleIsInvalid if *v == nil { - sv = make([]string, 0) + sv = &types.ReceiptHandleIsInvalid{} } else { sv = *v } - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } - sv = append(sv, mv) } *v = sv return nil } -func awsAwsquery_deserializeDocumentReceiptHandleIsInvalid(v **types.ReceiptHandleIsInvalid, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentRequestThrottled(v **types.RequestThrottled, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ReceiptHandleIsInvalid + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RequestThrottled if *v == nil { - sv = &types.ReceiptHandleIsInvalid{} + sv = &types.RequestThrottled{} } else { sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} @@ -4194,35 +5767,39 @@ func awsAwsquery_deserializeDocumentResourceNotFoundException(v **types.Resource sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(v **types.SendMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentSendMessageBatchResultEntry(v **types.SendMessageBatchResultEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.SendMessageBatchResultEntry if *v == nil { sv = &types.SendMessageBatchResultEntry{} @@ -4230,359 +5807,190 @@ func awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(v **types.SendMe sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) } - case strings.EqualFold("MD5OfMessageAttributes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageAttributes = ptr.String(xtv) + case "MD5OfMessageAttributes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageAttributes = ptr.String(jtv) } - case strings.EqualFold("MD5OfMessageBody", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageBody = ptr.String(xtv) + case "MD5OfMessageBody": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageBody = ptr.String(jtv) } - case strings.EqualFold("MD5OfMessageSystemAttributes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageSystemAttributes = ptr.String(xtv) + case "MD5OfMessageSystemAttributes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageSystemAttributes = ptr.String(jtv) } - case strings.EqualFold("MessageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MessageId = ptr.String(xtv) + case "MessageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MessageId = ptr.String(jtv) } - case strings.EqualFold("SequenceNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SequenceNumber = ptr.String(xtv) + case "SequenceNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SequenceNumber = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentSendMessageBatchResultEntryList(v *[]types.SendMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentSendMessageBatchResultEntryList(v *[]types.SendMessageBatchResultEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.SendMessageBatchResultEntry - if *v == nil { - sv = make([]types.SendMessageBatchResultEntry, 0) - } else { - sv = *v + if value == nil { + return nil } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("member", t.Name.Local): - var col types.SendMessageBatchResultEntry - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(&destAddr, nodeDecoder); err != nil { - return err - } - col = *destAddr - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentSendMessageBatchResultEntryListUnwrapped(v *[]types.SendMessageBatchResultEntry, decoder smithyxml.NodeDecoder) error { - var sv []types.SendMessageBatchResultEntry + var cv []types.SendMessageBatchResultEntry if *v == nil { - sv = make([]types.SendMessageBatchResultEntry, 0) + cv = []types.SendMessageBatchResultEntry{} } else { - sv = *v + cv = *v } - switch { - default: - var mv types.SendMessageBatchResultEntry - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsAwsquery_deserializeDocumentSendMessageBatchResultEntry(&destAddr, nodeDecoder); err != nil { + for _, value := range shape { + var col types.SendMessageBatchResultEntry + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSendMessageBatchResultEntry(&destAddr, value); err != nil { return err } - mv = *destAddr - sv = append(sv, mv) + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsquery_deserializeDocumentStringList(v *[]string, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v + if value == nil { + return nil } - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder - switch { - case strings.EqualFold("StringListValue", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } - sv = append(sv, col) - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string + var cv []string if *v == nil { - sv = make([]string, 0) + cv = []string{} } else { - sv = *v + cv = *v } - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv } - sv = append(sv, mv) + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsquery_deserializeDocumentTagMap(v *map[string]string, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv map[string]string - if *v == nil { - sv = make(map[string]string, 0) - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("entry", t.Name.Local): - entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTagMapUnwrapped(&sv, entryDecoder); err != nil { - return err - } - - default: - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } + if value == nil { + return nil } - *v = sv - return nil -} -func awsAwsquery_deserializeDocumentTagMapUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { - var sv map[string]string - if *v == nil { - sv = make(map[string]string, 0) - } else { - sv = *v + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - var ek string - var ev string - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - sv[ek] = ev - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Key", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ek = xtv - } - - case strings.EqualFold("Value", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - ev = xtv - } + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } - default: - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } - + parsedVal = jtv } - decoder = originalDecoder + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsAwsquery_deserializeDocumentTooManyEntriesInBatchRequest(v **types.TooManyEntriesInBatchRequest, decoder smithyxml.NodeDecoder) error { + +func awsAwsjson10_deserializeDocumentTooManyEntriesInBatchRequest(v **types.TooManyEntriesInBatchRequest, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.TooManyEntriesInBatchRequest if *v == nil { sv = &types.TooManyEntriesInBatchRequest{} @@ -4590,35 +5998,39 @@ func awsAwsquery_deserializeDocumentTooManyEntriesInBatchRequest(v **types.TooMa sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeDocumentUnsupportedOperation(v **types.UnsupportedOperation, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeDocumentUnsupportedOperation(v **types.UnsupportedOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *types.UnsupportedOperation if *v == nil { sv = &types.UnsupportedOperation{} @@ -4626,35 +6038,39 @@ func awsAwsquery_deserializeDocumentUnsupportedOperation(v **types.UnsupportedOp sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } + default: + _, _ = key, value + } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentCancelMessageMoveTaskOutput(v **CancelMessageMoveTaskOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentCancelMessageMoveTaskOutput(v **CancelMessageMoveTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *CancelMessageMoveTaskOutput if *v == nil { sv = &CancelMessageMoveTaskOutput{} @@ -4662,28 +6078,15 @@ func awsAwsquery_deserializeOpDocumentCancelMessageMoveTaskOutput(v **CancelMess sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ApproximateNumberOfMessagesMoved", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) + for key, value := range shape { + switch key { + case "ApproximateNumberOfMessagesMoved": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() if err != nil { return err } @@ -4691,23 +6094,27 @@ func awsAwsquery_deserializeOpDocumentCancelMessageMoveTaskOutput(v **CancelMess } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentChangeMessageVisibilityBatchOutput(v **ChangeMessageVisibilityBatchOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentChangeMessageVisibilityBatchOutput(v **ChangeMessageVisibilityBatchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *ChangeMessageVisibilityBatchOutput if *v == nil { sv = &ChangeMessageVisibilityBatchOutput{} @@ -4715,47 +6122,40 @@ func awsAwsquery_deserializeOpDocumentChangeMessageVisibilityBatchOutput(v **Cha sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("BatchResultErrorEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(&sv.Failed, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Failed": + if err := awsAwsjson10_deserializeDocumentBatchResultErrorEntryList(&sv.Failed, value); err != nil { return err } - case strings.EqualFold("ChangeMessageVisibilityBatchResultEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentChangeMessageVisibilityBatchResultEntryListUnwrapped(&sv.Successful, nodeDecoder); err != nil { + case "Successful": + if err := awsAwsjson10_deserializeDocumentChangeMessageVisibilityBatchResultEntryList(&sv.Successful, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *CreateQueueOutput if *v == nil { sv = &CreateQueueOutput{} @@ -4763,48 +6163,39 @@ func awsAwsquery_deserializeOpDocumentCreateQueueOutput(v **CreateQueueOutput, d sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("QueueUrl", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.QueueUrl = ptr.String(xtv) + for key, value := range shape { + switch key { + case "QueueUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QueueUrl = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentDeleteMessageBatchOutput(v **DeleteMessageBatchOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentDeleteMessageBatchOutput(v **DeleteMessageBatchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *DeleteMessageBatchOutput if *v == nil { sv = &DeleteMessageBatchOutput{} @@ -4812,47 +6203,40 @@ func awsAwsquery_deserializeOpDocumentDeleteMessageBatchOutput(v **DeleteMessage sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("BatchResultErrorEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(&sv.Failed, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Failed": + if err := awsAwsjson10_deserializeDocumentBatchResultErrorEntryList(&sv.Failed, value); err != nil { return err } - case strings.EqualFold("DeleteMessageBatchResultEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentDeleteMessageBatchResultEntryListUnwrapped(&sv.Successful, nodeDecoder); err != nil { + case "Successful": + if err := awsAwsjson10_deserializeDocumentDeleteMessageBatchResultEntryList(&sv.Successful, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentGetQueueAttributesOutput(v **GetQueueAttributesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentGetQueueAttributesOutput(v **GetQueueAttributesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *GetQueueAttributesOutput if *v == nil { sv = &GetQueueAttributesOutput{} @@ -4860,41 +6244,35 @@ func awsAwsquery_deserializeOpDocumentGetQueueAttributesOutput(v **GetQueueAttri sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Attribute", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentQueueAttributeMapUnwrapped(&sv.Attributes, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Attributes": + if err := awsAwsjson10_deserializeDocumentQueueAttributeMap(&sv.Attributes, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentGetQueueUrlOutput(v **GetQueueUrlOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentGetQueueUrlOutput(v **GetQueueUrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *GetQueueUrlOutput if *v == nil { sv = &GetQueueUrlOutput{} @@ -4902,48 +6280,39 @@ func awsAwsquery_deserializeOpDocumentGetQueueUrlOutput(v **GetQueueUrlOutput, d sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("QueueUrl", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.QueueUrl = ptr.String(xtv) + for key, value := range shape { + switch key { + case "QueueUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QueueUrl = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentListDeadLetterSourceQueuesOutput(v **ListDeadLetterSourceQueuesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentListDeadLetterSourceQueuesOutput(v **ListDeadLetterSourceQueuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *ListDeadLetterSourceQueuesOutput if *v == nil { sv = &ListDeadLetterSourceQueuesOutput{} @@ -4951,54 +6320,44 @@ func awsAwsquery_deserializeOpDocumentListDeadLetterSourceQueuesOutput(v **ListD sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("NextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } - case strings.EqualFold("QueueUrl", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentQueueUrlListUnwrapped(&sv.QueueUrls, nodeDecoder); err != nil { + case "queueUrls": + if err := awsAwsjson10_deserializeDocumentQueueUrlList(&sv.QueueUrls, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentListMessageMoveTasksOutput(v **ListMessageMoveTasksOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentListMessageMoveTasksOutput(v **ListMessageMoveTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *ListMessageMoveTasksOutput if *v == nil { sv = &ListMessageMoveTasksOutput{} @@ -5006,41 +6365,35 @@ func awsAwsquery_deserializeOpDocumentListMessageMoveTasksOutput(v **ListMessage sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("ListMessageMoveTasksResultEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentListMessageMoveTasksResultEntryListUnwrapped(&sv.Results, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Results": + if err := awsAwsjson10_deserializeDocumentListMessageMoveTasksResultEntryList(&sv.Results, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *ListQueuesOutput if *v == nil { sv = &ListQueuesOutput{} @@ -5048,54 +6401,44 @@ func awsAwsquery_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, dec sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("NextToken", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextToken = ptr.String(xtv) + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) } - case strings.EqualFold("QueueUrl", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentQueueUrlListUnwrapped(&sv.QueueUrls, nodeDecoder); err != nil { + case "QueueUrls": + if err := awsAwsjson10_deserializeDocumentQueueUrlList(&sv.QueueUrls, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentListQueueTagsOutput(v **ListQueueTagsOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentListQueueTagsOutput(v **ListQueueTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *ListQueueTagsOutput if *v == nil { sv = &ListQueueTagsOutput{} @@ -5103,41 +6446,35 @@ func awsAwsquery_deserializeOpDocumentListQueueTagsOutput(v **ListQueueTagsOutpu sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Tag", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentTagMapUnwrapped(&sv.Tags, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Tags": + if err := awsAwsjson10_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentReceiveMessageOutput(v **ReceiveMessageOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentReceiveMessageOutput(v **ReceiveMessageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *ReceiveMessageOutput if *v == nil { sv = &ReceiveMessageOutput{} @@ -5145,41 +6482,35 @@ func awsAwsquery_deserializeOpDocumentReceiveMessageOutput(v **ReceiveMessageOut sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Message", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentMessageListUnwrapped(&sv.Messages, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Messages": + if err := awsAwsjson10_deserializeDocumentMessageList(&sv.Messages, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentSendMessageBatchOutput(v **SendMessageBatchOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentSendMessageBatchOutput(v **SendMessageBatchOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *SendMessageBatchOutput if *v == nil { sv = &SendMessageBatchOutput{} @@ -5187,47 +6518,40 @@ func awsAwsquery_deserializeOpDocumentSendMessageBatchOutput(v **SendMessageBatc sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("BatchResultErrorEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentBatchResultErrorEntryListUnwrapped(&sv.Failed, nodeDecoder); err != nil { + for key, value := range shape { + switch key { + case "Failed": + if err := awsAwsjson10_deserializeDocumentBatchResultErrorEntryList(&sv.Failed, value); err != nil { return err } - case strings.EqualFold("SendMessageBatchResultEntry", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsAwsquery_deserializeDocumentSendMessageBatchResultEntryListUnwrapped(&sv.Successful, nodeDecoder); err != nil { + case "Successful": + if err := awsAwsjson10_deserializeDocumentSendMessageBatchResultEntryList(&sv.Successful, value); err != nil { return err } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentSendMessageOutput(v **SendMessageOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentSendMessageOutput(v **SendMessageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *SendMessageOutput if *v == nil { sv = &SendMessageOutput{} @@ -5235,100 +6559,75 @@ func awsAwsquery_deserializeOpDocumentSendMessageOutput(v **SendMessageOutput, d sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("MD5OfMessageAttributes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageAttributes = ptr.String(xtv) + for key, value := range shape { + switch key { + case "MD5OfMessageAttributes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageAttributes = ptr.String(jtv) } - case strings.EqualFold("MD5OfMessageBody", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageBody = ptr.String(xtv) + case "MD5OfMessageBody": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageBody = ptr.String(jtv) } - case strings.EqualFold("MD5OfMessageSystemAttributes", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MD5OfMessageSystemAttributes = ptr.String(xtv) + case "MD5OfMessageSystemAttributes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MD5OfMessageSystemAttributes = ptr.String(jtv) } - case strings.EqualFold("MessageId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.MessageId = ptr.String(xtv) + case "MessageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.MessageId = ptr.String(jtv) } - case strings.EqualFold("SequenceNumber", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SequenceNumber = ptr.String(xtv) + case "SequenceNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SequenceNumber = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } -func awsAwsquery_deserializeOpDocumentStartMessageMoveTaskOutput(v **StartMessageMoveTaskOutput, decoder smithyxml.NodeDecoder) error { +func awsAwsjson10_deserializeOpDocumentStartMessageMoveTaskOutput(v **StartMessageMoveTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + var sv *StartMessageMoveTaskOutput if *v == nil { sv = &StartMessageMoveTaskOutput{} @@ -5336,40 +6635,33 @@ func awsAwsquery_deserializeOpDocumentStartMessageMoveTaskOutput(v **StartMessag sv = *v } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("TaskHandle", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TaskHandle = ptr.String(xtv) + for key, value := range shape { + switch key { + case "TaskHandle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TaskHandle = ptr.String(jtv) } default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } + _, _ = key, value } - decoder = originalDecoder } *v = sv return nil } + +func getAwsQueryErrorCode(response *smithyhttp.Response) string { + queryCodeHeader := response.Header.Get("x-amzn-query-error") + if queryCodeHeader != "" { + queryCodeParts := strings.Split(queryCodeHeader, ";") + if len(queryCodeParts) == 2 { + return queryCodeParts[0] + } + } + return "" +} diff --git a/service/sqs/endpoints.go b/service/sqs/endpoints.go index 33c448e1a2c..8baf53a735f 100644 --- a/service/sqs/endpoints.go +++ b/service/sqs/endpoints.go @@ -430,8 +430,8 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - if "aws-us-gov" == _PartitionResult.Name { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { uriString := func() string { var out strings.Builder out.WriteString("https://sqs.") diff --git a/service/sqs/serializers.go b/service/sqs/serializers.go index 0d192964752..ddac08da6a5 100644 --- a/service/sqs/serializers.go +++ b/service/sqs/serializers.go @@ -6,24 +6,23 @@ import ( "bytes" "context" "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/query" "github.com/aws/aws-sdk-go-v2/service/sqs/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "path" - "sort" ) -type awsAwsquery_serializeOpAddPermission struct { +type awsAwsjson10_serializeOpAddPermission struct { } -func (*awsAwsquery_serializeOpAddPermission) ID() string { +func (*awsAwsjson10_serializeOpAddPermission) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpAddPermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpAddPermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -51,24 +50,15 @@ func (m *awsAwsquery_serializeOpAddPermission) HandleSerialize(ctx context.Conte if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.AddPermission") - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("AddPermission") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentAddPermissionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentAddPermissionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -80,14 +70,14 @@ func (m *awsAwsquery_serializeOpAddPermission) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpCancelMessageMoveTask struct { +type awsAwsjson10_serializeOpCancelMessageMoveTask struct { } -func (*awsAwsquery_serializeOpCancelMessageMoveTask) ID() string { +func (*awsAwsjson10_serializeOpCancelMessageMoveTask) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpCancelMessageMoveTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpCancelMessageMoveTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -115,24 +105,15 @@ func (m *awsAwsquery_serializeOpCancelMessageMoveTask) HandleSerialize(ctx conte if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.CancelMessageMoveTask") - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CancelMessageMoveTask") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentCancelMessageMoveTaskInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCancelMessageMoveTaskInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -144,14 +125,14 @@ func (m *awsAwsquery_serializeOpCancelMessageMoveTask) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpChangeMessageVisibility struct { +type awsAwsjson10_serializeOpChangeMessageVisibility struct { } -func (*awsAwsquery_serializeOpChangeMessageVisibility) ID() string { +func (*awsAwsjson10_serializeOpChangeMessageVisibility) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpChangeMessageVisibility) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpChangeMessageVisibility) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -179,24 +160,15 @@ func (m *awsAwsquery_serializeOpChangeMessageVisibility) HandleSerialize(ctx con if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ChangeMessageVisibility") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentChangeMessageVisibilityInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ChangeMessageVisibility") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentChangeMessageVisibilityInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -208,14 +180,14 @@ func (m *awsAwsquery_serializeOpChangeMessageVisibility) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpChangeMessageVisibilityBatch struct { +type awsAwsjson10_serializeOpChangeMessageVisibilityBatch struct { } -func (*awsAwsquery_serializeOpChangeMessageVisibilityBatch) ID() string { +func (*awsAwsjson10_serializeOpChangeMessageVisibilityBatch) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpChangeMessageVisibilityBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpChangeMessageVisibilityBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -243,24 +215,15 @@ func (m *awsAwsquery_serializeOpChangeMessageVisibilityBatch) HandleSerialize(ct if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ChangeMessageVisibilityBatch") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentChangeMessageVisibilityBatchInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ChangeMessageVisibilityBatch") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentChangeMessageVisibilityBatchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -272,14 +235,14 @@ func (m *awsAwsquery_serializeOpChangeMessageVisibilityBatch) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpCreateQueue struct { +type awsAwsjson10_serializeOpCreateQueue struct { } -func (*awsAwsquery_serializeOpCreateQueue) ID() string { +func (*awsAwsjson10_serializeOpCreateQueue) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpCreateQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpCreateQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -307,24 +270,15 @@ func (m *awsAwsquery_serializeOpCreateQueue) HandleSerialize(ctx context.Context if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.CreateQueue") - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("CreateQueue") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentCreateQueueInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateQueueInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -336,14 +290,14 @@ func (m *awsAwsquery_serializeOpCreateQueue) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpDeleteMessage struct { +type awsAwsjson10_serializeOpDeleteMessage struct { } -func (*awsAwsquery_serializeOpDeleteMessage) ID() string { +func (*awsAwsjson10_serializeOpDeleteMessage) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpDeleteMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpDeleteMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -371,24 +325,15 @@ func (m *awsAwsquery_serializeOpDeleteMessage) HandleSerialize(ctx context.Conte if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteMessage") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.DeleteMessage") - if err := awsAwsquery_serializeOpDocumentDeleteMessageInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteMessageInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -400,14 +345,14 @@ func (m *awsAwsquery_serializeOpDeleteMessage) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpDeleteMessageBatch struct { +type awsAwsjson10_serializeOpDeleteMessageBatch struct { } -func (*awsAwsquery_serializeOpDeleteMessageBatch) ID() string { +func (*awsAwsjson10_serializeOpDeleteMessageBatch) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpDeleteMessageBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpDeleteMessageBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -435,24 +380,15 @@ func (m *awsAwsquery_serializeOpDeleteMessageBatch) HandleSerialize(ctx context. if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.DeleteMessageBatch") - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteMessageBatch") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentDeleteMessageBatchInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteMessageBatchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -464,14 +400,14 @@ func (m *awsAwsquery_serializeOpDeleteMessageBatch) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpDeleteQueue struct { +type awsAwsjson10_serializeOpDeleteQueue struct { } -func (*awsAwsquery_serializeOpDeleteQueue) ID() string { +func (*awsAwsjson10_serializeOpDeleteQueue) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpDeleteQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpDeleteQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -499,24 +435,15 @@ func (m *awsAwsquery_serializeOpDeleteQueue) HandleSerialize(ctx context.Context if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("DeleteQueue") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.DeleteQueue") - if err := awsAwsquery_serializeOpDocumentDeleteQueueInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteQueueInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -528,14 +455,14 @@ func (m *awsAwsquery_serializeOpDeleteQueue) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpGetQueueAttributes struct { +type awsAwsjson10_serializeOpGetQueueAttributes struct { } -func (*awsAwsquery_serializeOpGetQueueAttributes) ID() string { +func (*awsAwsjson10_serializeOpGetQueueAttributes) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpGetQueueAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpGetQueueAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -563,24 +490,15 @@ func (m *awsAwsquery_serializeOpGetQueueAttributes) HandleSerialize(ctx context. if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetQueueAttributes") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.GetQueueAttributes") - if err := awsAwsquery_serializeOpDocumentGetQueueAttributesInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetQueueAttributesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -592,14 +510,14 @@ func (m *awsAwsquery_serializeOpGetQueueAttributes) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpGetQueueUrl struct { +type awsAwsjson10_serializeOpGetQueueUrl struct { } -func (*awsAwsquery_serializeOpGetQueueUrl) ID() string { +func (*awsAwsjson10_serializeOpGetQueueUrl) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpGetQueueUrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpGetQueueUrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -627,24 +545,15 @@ func (m *awsAwsquery_serializeOpGetQueueUrl) HandleSerialize(ctx context.Context if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("GetQueueUrl") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentGetQueueUrlInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.GetQueueUrl") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetQueueUrlInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -656,14 +565,14 @@ func (m *awsAwsquery_serializeOpGetQueueUrl) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpListDeadLetterSourceQueues struct { +type awsAwsjson10_serializeOpListDeadLetterSourceQueues struct { } -func (*awsAwsquery_serializeOpListDeadLetterSourceQueues) ID() string { +func (*awsAwsjson10_serializeOpListDeadLetterSourceQueues) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpListDeadLetterSourceQueues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpListDeadLetterSourceQueues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -691,24 +600,15 @@ func (m *awsAwsquery_serializeOpListDeadLetterSourceQueues) HandleSerialize(ctx if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ListDeadLetterSourceQueues") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ListDeadLetterSourceQueues") - if err := awsAwsquery_serializeOpDocumentListDeadLetterSourceQueuesInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListDeadLetterSourceQueuesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -720,14 +620,14 @@ func (m *awsAwsquery_serializeOpListDeadLetterSourceQueues) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpListMessageMoveTasks struct { +type awsAwsjson10_serializeOpListMessageMoveTasks struct { } -func (*awsAwsquery_serializeOpListMessageMoveTasks) ID() string { +func (*awsAwsjson10_serializeOpListMessageMoveTasks) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpListMessageMoveTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpListMessageMoveTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -755,24 +655,15 @@ func (m *awsAwsquery_serializeOpListMessageMoveTasks) HandleSerialize(ctx contex if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ListMessageMoveTasks") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentListMessageMoveTasksInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ListMessageMoveTasks") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListMessageMoveTasksInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -784,14 +675,14 @@ func (m *awsAwsquery_serializeOpListMessageMoveTasks) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpListQueues struct { +type awsAwsjson10_serializeOpListQueues struct { } -func (*awsAwsquery_serializeOpListQueues) ID() string { +func (*awsAwsjson10_serializeOpListQueues) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpListQueues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpListQueues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -819,24 +710,15 @@ func (m *awsAwsquery_serializeOpListQueues) HandleSerialize(ctx context.Context, if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ListQueues") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentListQueuesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ListQueues") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListQueuesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -848,14 +730,14 @@ func (m *awsAwsquery_serializeOpListQueues) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpListQueueTags struct { +type awsAwsjson10_serializeOpListQueueTags struct { } -func (*awsAwsquery_serializeOpListQueueTags) ID() string { +func (*awsAwsjson10_serializeOpListQueueTags) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpListQueueTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpListQueueTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -883,24 +765,15 @@ func (m *awsAwsquery_serializeOpListQueueTags) HandleSerialize(ctx context.Conte if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ListQueueTags") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentListQueueTagsInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ListQueueTags") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListQueueTagsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -912,14 +785,14 @@ func (m *awsAwsquery_serializeOpListQueueTags) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpPurgeQueue struct { +type awsAwsjson10_serializeOpPurgeQueue struct { } -func (*awsAwsquery_serializeOpPurgeQueue) ID() string { +func (*awsAwsjson10_serializeOpPurgeQueue) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpPurgeQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpPurgeQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -947,24 +820,15 @@ func (m *awsAwsquery_serializeOpPurgeQueue) HandleSerialize(ctx context.Context, if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.PurgeQueue") - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("PurgeQueue") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentPurgeQueueInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentPurgeQueueInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -976,14 +840,14 @@ func (m *awsAwsquery_serializeOpPurgeQueue) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpReceiveMessage struct { +type awsAwsjson10_serializeOpReceiveMessage struct { } -func (*awsAwsquery_serializeOpReceiveMessage) ID() string { +func (*awsAwsjson10_serializeOpReceiveMessage) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpReceiveMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpReceiveMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1011,24 +875,15 @@ func (m *awsAwsquery_serializeOpReceiveMessage) HandleSerialize(ctx context.Cont if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("ReceiveMessage") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.ReceiveMessage") - if err := awsAwsquery_serializeOpDocumentReceiveMessageInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentReceiveMessageInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1040,14 +895,14 @@ func (m *awsAwsquery_serializeOpReceiveMessage) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpRemovePermission struct { +type awsAwsjson10_serializeOpRemovePermission struct { } -func (*awsAwsquery_serializeOpRemovePermission) ID() string { +func (*awsAwsjson10_serializeOpRemovePermission) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpRemovePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpRemovePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1075,24 +930,15 @@ func (m *awsAwsquery_serializeOpRemovePermission) HandleSerialize(ctx context.Co if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("RemovePermission") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentRemovePermissionInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.RemovePermission") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentRemovePermissionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1104,14 +950,14 @@ func (m *awsAwsquery_serializeOpRemovePermission) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpSendMessage struct { +type awsAwsjson10_serializeOpSendMessage struct { } -func (*awsAwsquery_serializeOpSendMessage) ID() string { +func (*awsAwsjson10_serializeOpSendMessage) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpSendMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpSendMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1139,24 +985,15 @@ func (m *awsAwsquery_serializeOpSendMessage) HandleSerialize(ctx context.Context if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SendMessage") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.SendMessage") - if err := awsAwsquery_serializeOpDocumentSendMessageInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentSendMessageInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1168,14 +1005,14 @@ func (m *awsAwsquery_serializeOpSendMessage) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpSendMessageBatch struct { +type awsAwsjson10_serializeOpSendMessageBatch struct { } -func (*awsAwsquery_serializeOpSendMessageBatch) ID() string { +func (*awsAwsjson10_serializeOpSendMessageBatch) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpSendMessageBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpSendMessageBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1203,24 +1040,15 @@ func (m *awsAwsquery_serializeOpSendMessageBatch) HandleSerialize(ctx context.Co if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SendMessageBatch") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.SendMessageBatch") - if err := awsAwsquery_serializeOpDocumentSendMessageBatchInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentSendMessageBatchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1232,14 +1060,14 @@ func (m *awsAwsquery_serializeOpSendMessageBatch) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpSetQueueAttributes struct { +type awsAwsjson10_serializeOpSetQueueAttributes struct { } -func (*awsAwsquery_serializeOpSetQueueAttributes) ID() string { +func (*awsAwsjson10_serializeOpSetQueueAttributes) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpSetQueueAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpSetQueueAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1267,24 +1095,15 @@ func (m *awsAwsquery_serializeOpSetQueueAttributes) HandleSerialize(ctx context. if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("SetQueueAttributes") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentSetQueueAttributesInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.SetQueueAttributes") - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentSetQueueAttributesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1296,14 +1115,14 @@ func (m *awsAwsquery_serializeOpSetQueueAttributes) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpStartMessageMoveTask struct { +type awsAwsjson10_serializeOpStartMessageMoveTask struct { } -func (*awsAwsquery_serializeOpStartMessageMoveTask) ID() string { +func (*awsAwsjson10_serializeOpStartMessageMoveTask) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpStartMessageMoveTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpStartMessageMoveTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1331,24 +1150,15 @@ func (m *awsAwsquery_serializeOpStartMessageMoveTask) HandleSerialize(ctx contex if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("StartMessageMoveTask") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.StartMessageMoveTask") - if err := awsAwsquery_serializeOpDocumentStartMessageMoveTaskInput(input, bodyEncoder.Value); err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentStartMessageMoveTaskInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - err = bodyEncoder.Encode() - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1360,14 +1170,14 @@ func (m *awsAwsquery_serializeOpStartMessageMoveTask) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpTagQueue struct { +type awsAwsjson10_serializeOpTagQueue struct { } -func (*awsAwsquery_serializeOpTagQueue) ID() string { +func (*awsAwsjson10_serializeOpTagQueue) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpTagQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpTagQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1395,24 +1205,15 @@ func (m *awsAwsquery_serializeOpTagQueue) HandleSerialize(ctx context.Context, i if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") - - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("TagQueue") - body.Key("Version").String("2012-11-05") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.TagQueue") - if err := awsAwsquery_serializeOpDocumentTagQueueInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentTagQueueInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1424,14 +1225,14 @@ func (m *awsAwsquery_serializeOpTagQueue) HandleSerialize(ctx context.Context, i return next.HandleSerialize(ctx, in) } -type awsAwsquery_serializeOpUntagQueue struct { +type awsAwsjson10_serializeOpUntagQueue struct { } -func (*awsAwsquery_serializeOpUntagQueue) ID() string { +func (*awsAwsjson10_serializeOpUntagQueue) ID() string { return "OperationSerializer" } -func (m *awsAwsquery_serializeOpUntagQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUntagQueue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1459,24 +1260,15 @@ func (m *awsAwsquery_serializeOpUntagQueue) HandleSerialize(ctx context.Context, if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSQS.UntagQueue") - bodyWriter := bytes.NewBuffer(nil) - bodyEncoder := query.NewEncoder(bodyWriter) - body := bodyEncoder.Object() - body.Key("Action").String("UntagQueue") - body.Key("Version").String("2012-11-05") - - if err := awsAwsquery_serializeOpDocumentUntagQueueInput(input, bodyEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - err = bodyEncoder.Encode() - if err != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUntagQueueInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1487,8 +1279,9 @@ func (m *awsAwsquery_serializeOpUntagQueue) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -func awsAwsquery_serializeDocumentActionNameList(v []string, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentActionNameList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -1497,8 +1290,9 @@ func awsAwsquery_serializeDocumentActionNameList(v []string, value query.Value) return nil } -func awsAwsquery_serializeDocumentAttributeNameList(v []types.QueueAttributeName, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentAttributeNameList(v []types.QueueAttributeName, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -1507,8 +1301,9 @@ func awsAwsquery_serializeDocumentAttributeNameList(v []types.QueueAttributeName return nil } -func awsAwsquery_serializeDocumentAWSAccountIdList(v []string, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentAWSAccountIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -1517,84 +1312,88 @@ func awsAwsquery_serializeDocumentAWSAccountIdList(v []string, value query.Value return nil } -func awsAwsquery_serializeDocumentBinaryList(v [][]byte, value query.Value) error { - array := value.Array("BinaryListValue") +func awsAwsjson10_serializeDocumentBinaryList(v [][]byte, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { + av := array.Value() if vv := v[i]; vv == nil { continue } - av := array.Value() av.Base64EncodeBytes(v[i]) } return nil } -func awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntry(v *types.ChangeMessageVisibilityBatchRequestEntry, value query.Value) error { +func awsAwsjson10_serializeDocumentChangeMessageVisibilityBatchRequestEntry(v *types.ChangeMessageVisibilityBatchRequestEntry, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Id != nil { - objectKey := object.Key("Id") - objectKey.String(*v.Id) + ok := object.Key("Id") + ok.String(*v.Id) } if v.ReceiptHandle != nil { - objectKey := object.Key("ReceiptHandle") - objectKey.String(*v.ReceiptHandle) + ok := object.Key("ReceiptHandle") + ok.String(*v.ReceiptHandle) } if v.VisibilityTimeout != 0 { - objectKey := object.Key("VisibilityTimeout") - objectKey.Integer(v.VisibilityTimeout) + ok := object.Key("VisibilityTimeout") + ok.Integer(v.VisibilityTimeout) } return nil } -func awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntryList(v []types.ChangeMessageVisibilityBatchRequestEntry, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentChangeMessageVisibilityBatchRequestEntryList(v []types.ChangeMessageVisibilityBatchRequestEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() - if err := awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntry(&v[i], av); err != nil { + if err := awsAwsjson10_serializeDocumentChangeMessageVisibilityBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } -func awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntry(v *types.DeleteMessageBatchRequestEntry, value query.Value) error { +func awsAwsjson10_serializeDocumentDeleteMessageBatchRequestEntry(v *types.DeleteMessageBatchRequestEntry, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Id != nil { - objectKey := object.Key("Id") - objectKey.String(*v.Id) + ok := object.Key("Id") + ok.String(*v.Id) } if v.ReceiptHandle != nil { - objectKey := object.Key("ReceiptHandle") - objectKey.String(*v.ReceiptHandle) + ok := object.Key("ReceiptHandle") + ok.String(*v.ReceiptHandle) } return nil } -func awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntryList(v []types.DeleteMessageBatchRequestEntry, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentDeleteMessageBatchRequestEntryList(v []types.DeleteMessageBatchRequestEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() - if err := awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntry(&v[i], av); err != nil { + if err := awsAwsjson10_serializeDocumentDeleteMessageBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } -func awsAwsquery_serializeDocumentMessageAttributeNameList(v []string, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentMessageAttributeNameList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -1603,180 +1402,156 @@ func awsAwsquery_serializeDocumentMessageAttributeNameList(v []string, value que return nil } -func awsAwsquery_serializeDocumentMessageAttributeValue(v *types.MessageAttributeValue, value query.Value) error { +func awsAwsjson10_serializeDocumentMessageAttributeValue(v *types.MessageAttributeValue, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.BinaryListValues != nil { - objectKey := object.FlatKey("BinaryListValue") - if err := awsAwsquery_serializeDocumentBinaryList(v.BinaryListValues, objectKey); err != nil { + ok := object.Key("BinaryListValues") + if err := awsAwsjson10_serializeDocumentBinaryList(v.BinaryListValues, ok); err != nil { return err } } if v.BinaryValue != nil { - objectKey := object.Key("BinaryValue") - objectKey.Base64EncodeBytes(v.BinaryValue) + ok := object.Key("BinaryValue") + ok.Base64EncodeBytes(v.BinaryValue) } if v.DataType != nil { - objectKey := object.Key("DataType") - objectKey.String(*v.DataType) + ok := object.Key("DataType") + ok.String(*v.DataType) } if v.StringListValues != nil { - objectKey := object.FlatKey("StringListValue") - if err := awsAwsquery_serializeDocumentStringList(v.StringListValues, objectKey); err != nil { + ok := object.Key("StringListValues") + if err := awsAwsjson10_serializeDocumentStringList(v.StringListValues, ok); err != nil { return err } } if v.StringValue != nil { - objectKey := object.Key("StringValue") - objectKey.String(*v.StringValue) + ok := object.Key("StringValue") + ok.String(*v.StringValue) } return nil } -func awsAwsquery_serializeDocumentMessageBodyAttributeMap(v map[string]types.MessageAttributeValue, value query.Value) error { - if len(v) == 0 { - return nil - } - object := value.Map("Name", "Value") +func awsAwsjson10_serializeDocumentMessageBodyAttributeMap(v map[string]types.MessageAttributeValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - keys := make([]string, 0, len(v)) for key := range v { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { om := object.Key(key) mapVar := v[key] - if err := awsAwsquery_serializeDocumentMessageAttributeValue(&mapVar, om); err != nil { + if err := awsAwsjson10_serializeDocumentMessageAttributeValue(&mapVar, om); err != nil { return err } } return nil } -func awsAwsquery_serializeDocumentMessageBodySystemAttributeMap(v map[string]types.MessageSystemAttributeValue, value query.Value) error { - if len(v) == 0 { - return nil - } - object := value.Map("Name", "Value") +func awsAwsjson10_serializeDocumentMessageBodySystemAttributeMap(v map[string]types.MessageSystemAttributeValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - keys := make([]string, 0, len(v)) for key := range v { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { om := object.Key(key) mapVar := v[key] - if err := awsAwsquery_serializeDocumentMessageSystemAttributeValue(&mapVar, om); err != nil { + if err := awsAwsjson10_serializeDocumentMessageSystemAttributeValue(&mapVar, om); err != nil { return err } } return nil } -func awsAwsquery_serializeDocumentMessageSystemAttributeValue(v *types.MessageSystemAttributeValue, value query.Value) error { +func awsAwsjson10_serializeDocumentMessageSystemAttributeValue(v *types.MessageSystemAttributeValue, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.BinaryListValues != nil { - objectKey := object.FlatKey("BinaryListValue") - if err := awsAwsquery_serializeDocumentBinaryList(v.BinaryListValues, objectKey); err != nil { + ok := object.Key("BinaryListValues") + if err := awsAwsjson10_serializeDocumentBinaryList(v.BinaryListValues, ok); err != nil { return err } } if v.BinaryValue != nil { - objectKey := object.Key("BinaryValue") - objectKey.Base64EncodeBytes(v.BinaryValue) + ok := object.Key("BinaryValue") + ok.Base64EncodeBytes(v.BinaryValue) } if v.DataType != nil { - objectKey := object.Key("DataType") - objectKey.String(*v.DataType) + ok := object.Key("DataType") + ok.String(*v.DataType) } if v.StringListValues != nil { - objectKey := object.FlatKey("StringListValue") - if err := awsAwsquery_serializeDocumentStringList(v.StringListValues, objectKey); err != nil { + ok := object.Key("StringListValues") + if err := awsAwsjson10_serializeDocumentStringList(v.StringListValues, ok); err != nil { return err } } if v.StringValue != nil { - objectKey := object.Key("StringValue") - objectKey.String(*v.StringValue) + ok := object.Key("StringValue") + ok.String(*v.StringValue) } return nil } -func awsAwsquery_serializeDocumentQueueAttributeMap(v map[string]string, value query.Value) error { - if len(v) == 0 { - return nil - } - object := value.Map("Name", "Value") +func awsAwsjson10_serializeDocumentQueueAttributeMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - keys := make([]string, 0, len(v)) for key := range v { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } -func awsAwsquery_serializeDocumentSendMessageBatchRequestEntry(v *types.SendMessageBatchRequestEntry, value query.Value) error { +func awsAwsjson10_serializeDocumentSendMessageBatchRequestEntry(v *types.SendMessageBatchRequestEntry, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.DelaySeconds != 0 { - objectKey := object.Key("DelaySeconds") - objectKey.Integer(v.DelaySeconds) + ok := object.Key("DelaySeconds") + ok.Integer(v.DelaySeconds) } if v.Id != nil { - objectKey := object.Key("Id") - objectKey.String(*v.Id) + ok := object.Key("Id") + ok.String(*v.Id) } if v.MessageAttributes != nil { - objectKey := object.FlatKey("MessageAttribute") - if err := awsAwsquery_serializeDocumentMessageBodyAttributeMap(v.MessageAttributes, objectKey); err != nil { + ok := object.Key("MessageAttributes") + if err := awsAwsjson10_serializeDocumentMessageBodyAttributeMap(v.MessageAttributes, ok); err != nil { return err } } if v.MessageBody != nil { - objectKey := object.Key("MessageBody") - objectKey.String(*v.MessageBody) + ok := object.Key("MessageBody") + ok.String(*v.MessageBody) } if v.MessageDeduplicationId != nil { - objectKey := object.Key("MessageDeduplicationId") - objectKey.String(*v.MessageDeduplicationId) + ok := object.Key("MessageDeduplicationId") + ok.String(*v.MessageDeduplicationId) } if v.MessageGroupId != nil { - objectKey := object.Key("MessageGroupId") - objectKey.String(*v.MessageGroupId) + ok := object.Key("MessageGroupId") + ok.String(*v.MessageGroupId) } if v.MessageSystemAttributes != nil { - objectKey := object.FlatKey("MessageSystemAttribute") - if err := awsAwsquery_serializeDocumentMessageBodySystemAttributeMap(v.MessageSystemAttributes, objectKey); err != nil { + ok := object.Key("MessageSystemAttributes") + if err := awsAwsjson10_serializeDocumentMessageBodySystemAttributeMap(v.MessageSystemAttributes, ok); err != nil { return err } } @@ -1784,20 +1559,22 @@ func awsAwsquery_serializeDocumentSendMessageBatchRequestEntry(v *types.SendMess return nil } -func awsAwsquery_serializeDocumentSendMessageBatchRequestEntryList(v []types.SendMessageBatchRequestEntry, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentSendMessageBatchRequestEntryList(v []types.SendMessageBatchRequestEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() - if err := awsAwsquery_serializeDocumentSendMessageBatchRequestEntry(&v[i], av); err != nil { + if err := awsAwsjson10_serializeDocumentSendMessageBatchRequestEntry(&v[i], av); err != nil { return err } } return nil } -func awsAwsquery_serializeDocumentStringList(v []string, value query.Value) error { - array := value.Array("StringListValue") +func awsAwsjson10_serializeDocumentStringList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -1806,8 +1583,9 @@ func awsAwsquery_serializeDocumentStringList(v []string, value query.Value) erro return nil } -func awsAwsquery_serializeDocumentTagKeyList(v []string, value query.Value) error { - array := value.Array("member") +func awsAwsjson10_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -1816,128 +1594,120 @@ func awsAwsquery_serializeDocumentTagKeyList(v []string, value query.Value) erro return nil } -func awsAwsquery_serializeDocumentTagMap(v map[string]string, value query.Value) error { - if len(v) == 0 { - return nil - } - object := value.Map("Key", "Value") +func awsAwsjson10_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - keys := make([]string, 0, len(v)) for key := range v { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { om := object.Key(key) om.String(v[key]) } return nil } -func awsAwsquery_serializeOpDocumentAddPermissionInput(v *AddPermissionInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentAddPermissionInput(v *AddPermissionInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Actions != nil { - objectKey := object.FlatKey("ActionName") - if err := awsAwsquery_serializeDocumentActionNameList(v.Actions, objectKey); err != nil { + ok := object.Key("Actions") + if err := awsAwsjson10_serializeDocumentActionNameList(v.Actions, ok); err != nil { return err } } if v.AWSAccountIds != nil { - objectKey := object.FlatKey("AWSAccountId") - if err := awsAwsquery_serializeDocumentAWSAccountIdList(v.AWSAccountIds, objectKey); err != nil { + ok := object.Key("AWSAccountIds") + if err := awsAwsjson10_serializeDocumentAWSAccountIdList(v.AWSAccountIds, ok); err != nil { return err } } if v.Label != nil { - objectKey := object.Key("Label") - objectKey.String(*v.Label) + ok := object.Key("Label") + ok.String(*v.Label) } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentCancelMessageMoveTaskInput(v *CancelMessageMoveTaskInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentCancelMessageMoveTaskInput(v *CancelMessageMoveTaskInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.TaskHandle != nil { - objectKey := object.Key("TaskHandle") - objectKey.String(*v.TaskHandle) + ok := object.Key("TaskHandle") + ok.String(*v.TaskHandle) } return nil } -func awsAwsquery_serializeOpDocumentChangeMessageVisibilityBatchInput(v *ChangeMessageVisibilityBatchInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentChangeMessageVisibilityBatchInput(v *ChangeMessageVisibilityBatchInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Entries != nil { - objectKey := object.FlatKey("ChangeMessageVisibilityBatchRequestEntry") - if err := awsAwsquery_serializeDocumentChangeMessageVisibilityBatchRequestEntryList(v.Entries, objectKey); err != nil { + ok := object.Key("Entries") + if err := awsAwsjson10_serializeDocumentChangeMessageVisibilityBatchRequestEntryList(v.Entries, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentChangeMessageVisibilityInput(v *ChangeMessageVisibilityInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentChangeMessageVisibilityInput(v *ChangeMessageVisibilityInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } if v.ReceiptHandle != nil { - objectKey := object.Key("ReceiptHandle") - objectKey.String(*v.ReceiptHandle) + ok := object.Key("ReceiptHandle") + ok.String(*v.ReceiptHandle) } { - objectKey := object.Key("VisibilityTimeout") - objectKey.Integer(v.VisibilityTimeout) + ok := object.Key("VisibilityTimeout") + ok.Integer(v.VisibilityTimeout) } return nil } -func awsAwsquery_serializeOpDocumentCreateQueueInput(v *CreateQueueInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentCreateQueueInput(v *CreateQueueInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Attributes != nil { - objectKey := object.FlatKey("Attribute") - if err := awsAwsquery_serializeDocumentQueueAttributeMap(v.Attributes, objectKey); err != nil { + ok := object.Key("Attributes") + if err := awsAwsjson10_serializeDocumentQueueAttributeMap(v.Attributes, ok); err != nil { return err } } if v.QueueName != nil { - objectKey := object.Key("QueueName") - objectKey.String(*v.QueueName) + ok := object.Key("QueueName") + ok.String(*v.QueueName) } if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsAwsquery_serializeDocumentTagMap(v.Tags, objectKey); err != nil { + ok := object.Key("tags") + if err := awsAwsjson10_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } @@ -1945,356 +1715,356 @@ func awsAwsquery_serializeOpDocumentCreateQueueInput(v *CreateQueueInput, value return nil } -func awsAwsquery_serializeOpDocumentDeleteMessageBatchInput(v *DeleteMessageBatchInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentDeleteMessageBatchInput(v *DeleteMessageBatchInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Entries != nil { - objectKey := object.FlatKey("DeleteMessageBatchRequestEntry") - if err := awsAwsquery_serializeDocumentDeleteMessageBatchRequestEntryList(v.Entries, objectKey); err != nil { + ok := object.Key("Entries") + if err := awsAwsjson10_serializeDocumentDeleteMessageBatchRequestEntryList(v.Entries, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentDeleteMessageInput(v *DeleteMessageInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentDeleteMessageInput(v *DeleteMessageInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } if v.ReceiptHandle != nil { - objectKey := object.Key("ReceiptHandle") - objectKey.String(*v.ReceiptHandle) + ok := object.Key("ReceiptHandle") + ok.String(*v.ReceiptHandle) } return nil } -func awsAwsquery_serializeOpDocumentDeleteQueueInput(v *DeleteQueueInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentDeleteQueueInput(v *DeleteQueueInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentGetQueueAttributesInput(v *GetQueueAttributesInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentGetQueueAttributesInput(v *GetQueueAttributesInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.AttributeNames != nil { - objectKey := object.FlatKey("AttributeName") - if err := awsAwsquery_serializeDocumentAttributeNameList(v.AttributeNames, objectKey); err != nil { + ok := object.Key("AttributeNames") + if err := awsAwsjson10_serializeDocumentAttributeNameList(v.AttributeNames, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentGetQueueUrlInput(v *GetQueueUrlInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentGetQueueUrlInput(v *GetQueueUrlInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueName != nil { - objectKey := object.Key("QueueName") - objectKey.String(*v.QueueName) + ok := object.Key("QueueName") + ok.String(*v.QueueName) } if v.QueueOwnerAWSAccountId != nil { - objectKey := object.Key("QueueOwnerAWSAccountId") - objectKey.String(*v.QueueOwnerAWSAccountId) + ok := object.Key("QueueOwnerAWSAccountId") + ok.String(*v.QueueOwnerAWSAccountId) } return nil } -func awsAwsquery_serializeOpDocumentListDeadLetterSourceQueuesInput(v *ListDeadLetterSourceQueuesInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentListDeadLetterSourceQueuesInput(v *ListDeadLetterSourceQueuesInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) } if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) + ok := object.Key("NextToken") + ok.String(*v.NextToken) } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentListMessageMoveTasksInput(v *ListMessageMoveTasksInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentListMessageMoveTasksInput(v *ListMessageMoveTasksInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() - if v.MaxResults != 0 { - objectKey := object.Key("MaxResults") - objectKey.Integer(v.MaxResults) + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) } if v.SourceArn != nil { - objectKey := object.Key("SourceArn") - objectKey.String(*v.SourceArn) + ok := object.Key("SourceArn") + ok.String(*v.SourceArn) } return nil } -func awsAwsquery_serializeOpDocumentListQueuesInput(v *ListQueuesInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentListQueuesInput(v *ListQueuesInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.MaxResults != nil { - objectKey := object.Key("MaxResults") - objectKey.Integer(*v.MaxResults) + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) } if v.NextToken != nil { - objectKey := object.Key("NextToken") - objectKey.String(*v.NextToken) + ok := object.Key("NextToken") + ok.String(*v.NextToken) } if v.QueueNamePrefix != nil { - objectKey := object.Key("QueueNamePrefix") - objectKey.String(*v.QueueNamePrefix) + ok := object.Key("QueueNamePrefix") + ok.String(*v.QueueNamePrefix) } return nil } -func awsAwsquery_serializeOpDocumentListQueueTagsInput(v *ListQueueTagsInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentListQueueTagsInput(v *ListQueueTagsInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentPurgeQueueInput(v *PurgeQueueInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentPurgeQueueInput(v *PurgeQueueInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentReceiveMessageInput(v *ReceiveMessageInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentReceiveMessageInput(v *ReceiveMessageInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.AttributeNames != nil { - objectKey := object.FlatKey("AttributeName") - if err := awsAwsquery_serializeDocumentAttributeNameList(v.AttributeNames, objectKey); err != nil { + ok := object.Key("AttributeNames") + if err := awsAwsjson10_serializeDocumentAttributeNameList(v.AttributeNames, ok); err != nil { return err } } if v.MaxNumberOfMessages != 0 { - objectKey := object.Key("MaxNumberOfMessages") - objectKey.Integer(v.MaxNumberOfMessages) + ok := object.Key("MaxNumberOfMessages") + ok.Integer(v.MaxNumberOfMessages) } if v.MessageAttributeNames != nil { - objectKey := object.FlatKey("MessageAttributeName") - if err := awsAwsquery_serializeDocumentMessageAttributeNameList(v.MessageAttributeNames, objectKey); err != nil { + ok := object.Key("MessageAttributeNames") + if err := awsAwsjson10_serializeDocumentMessageAttributeNameList(v.MessageAttributeNames, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } if v.ReceiveRequestAttemptId != nil { - objectKey := object.Key("ReceiveRequestAttemptId") - objectKey.String(*v.ReceiveRequestAttemptId) + ok := object.Key("ReceiveRequestAttemptId") + ok.String(*v.ReceiveRequestAttemptId) } if v.VisibilityTimeout != 0 { - objectKey := object.Key("VisibilityTimeout") - objectKey.Integer(v.VisibilityTimeout) + ok := object.Key("VisibilityTimeout") + ok.Integer(v.VisibilityTimeout) } if v.WaitTimeSeconds != 0 { - objectKey := object.Key("WaitTimeSeconds") - objectKey.Integer(v.WaitTimeSeconds) + ok := object.Key("WaitTimeSeconds") + ok.Integer(v.WaitTimeSeconds) } return nil } -func awsAwsquery_serializeOpDocumentRemovePermissionInput(v *RemovePermissionInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentRemovePermissionInput(v *RemovePermissionInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Label != nil { - objectKey := object.Key("Label") - objectKey.String(*v.Label) + ok := object.Key("Label") + ok.String(*v.Label) } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentSendMessageBatchInput(v *SendMessageBatchInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentSendMessageBatchInput(v *SendMessageBatchInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Entries != nil { - objectKey := object.FlatKey("SendMessageBatchRequestEntry") - if err := awsAwsquery_serializeDocumentSendMessageBatchRequestEntryList(v.Entries, objectKey); err != nil { + ok := object.Key("Entries") + if err := awsAwsjson10_serializeDocumentSendMessageBatchRequestEntryList(v.Entries, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentSendMessageInput(v *SendMessageInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentSendMessageInput(v *SendMessageInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.DelaySeconds != 0 { - objectKey := object.Key("DelaySeconds") - objectKey.Integer(v.DelaySeconds) + ok := object.Key("DelaySeconds") + ok.Integer(v.DelaySeconds) } if v.MessageAttributes != nil { - objectKey := object.FlatKey("MessageAttribute") - if err := awsAwsquery_serializeDocumentMessageBodyAttributeMap(v.MessageAttributes, objectKey); err != nil { + ok := object.Key("MessageAttributes") + if err := awsAwsjson10_serializeDocumentMessageBodyAttributeMap(v.MessageAttributes, ok); err != nil { return err } } if v.MessageBody != nil { - objectKey := object.Key("MessageBody") - objectKey.String(*v.MessageBody) + ok := object.Key("MessageBody") + ok.String(*v.MessageBody) } if v.MessageDeduplicationId != nil { - objectKey := object.Key("MessageDeduplicationId") - objectKey.String(*v.MessageDeduplicationId) + ok := object.Key("MessageDeduplicationId") + ok.String(*v.MessageDeduplicationId) } if v.MessageGroupId != nil { - objectKey := object.Key("MessageGroupId") - objectKey.String(*v.MessageGroupId) + ok := object.Key("MessageGroupId") + ok.String(*v.MessageGroupId) } if v.MessageSystemAttributes != nil { - objectKey := object.FlatKey("MessageSystemAttribute") - if err := awsAwsquery_serializeDocumentMessageBodySystemAttributeMap(v.MessageSystemAttributes, objectKey); err != nil { + ok := object.Key("MessageSystemAttributes") + if err := awsAwsjson10_serializeDocumentMessageBodySystemAttributeMap(v.MessageSystemAttributes, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentSetQueueAttributesInput(v *SetQueueAttributesInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentSetQueueAttributesInput(v *SetQueueAttributesInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.Attributes != nil { - objectKey := object.FlatKey("Attribute") - if err := awsAwsquery_serializeDocumentQueueAttributeMap(v.Attributes, objectKey); err != nil { + ok := object.Key("Attributes") + if err := awsAwsjson10_serializeDocumentQueueAttributeMap(v.Attributes, ok); err != nil { return err } } if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } return nil } -func awsAwsquery_serializeOpDocumentStartMessageMoveTaskInput(v *StartMessageMoveTaskInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentStartMessageMoveTaskInput(v *StartMessageMoveTaskInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.DestinationArn != nil { - objectKey := object.Key("DestinationArn") - objectKey.String(*v.DestinationArn) + ok := object.Key("DestinationArn") + ok.String(*v.DestinationArn) } - if v.MaxNumberOfMessagesPerSecond != 0 { - objectKey := object.Key("MaxNumberOfMessagesPerSecond") - objectKey.Integer(v.MaxNumberOfMessagesPerSecond) + if v.MaxNumberOfMessagesPerSecond != nil { + ok := object.Key("MaxNumberOfMessagesPerSecond") + ok.Integer(*v.MaxNumberOfMessagesPerSecond) } if v.SourceArn != nil { - objectKey := object.Key("SourceArn") - objectKey.String(*v.SourceArn) + ok := object.Key("SourceArn") + ok.String(*v.SourceArn) } return nil } -func awsAwsquery_serializeOpDocumentTagQueueInput(v *TagQueueInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentTagQueueInput(v *TagQueueInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } if v.Tags != nil { - objectKey := object.FlatKey("Tag") - if err := awsAwsquery_serializeDocumentTagMap(v.Tags, objectKey); err != nil { + ok := object.Key("Tags") + if err := awsAwsjson10_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } @@ -2302,18 +2072,18 @@ func awsAwsquery_serializeOpDocumentTagQueueInput(v *TagQueueInput, value query. return nil } -func awsAwsquery_serializeOpDocumentUntagQueueInput(v *UntagQueueInput, value query.Value) error { +func awsAwsjson10_serializeOpDocumentUntagQueueInput(v *UntagQueueInput, value smithyjson.Value) error { object := value.Object() - _ = object + defer object.Close() if v.QueueUrl != nil { - objectKey := object.Key("QueueUrl") - objectKey.String(*v.QueueUrl) + ok := object.Key("QueueUrl") + ok.String(*v.QueueUrl) } if v.TagKeys != nil { - objectKey := object.FlatKey("TagKey") - if err := awsAwsquery_serializeDocumentTagKeyList(v.TagKeys, objectKey); err != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson10_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { return err } } diff --git a/service/sqs/types/enums.go b/service/sqs/types/enums.go index dbdc81c1e2e..e6466f15d61 100644 --- a/service/sqs/types/enums.go +++ b/service/sqs/types/enums.go @@ -108,3 +108,27 @@ func (QueueAttributeName) Values() []QueueAttributeName { "SqsManagedSseEnabled", } } + +type TaskStatus string + +// Enum values for TaskStatus +const ( + TaskStatusRunning TaskStatus = "RUNNING" + TaskStatusFailed TaskStatus = "FAILED" + TaskStatusCancelling TaskStatus = "CANCELLING" + TaskStatusCancelled TaskStatus = "CANCELLED" + TaskStatusCompleted TaskStatus = "COMPLETED" +) + +// Values returns all known values for TaskStatus. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (TaskStatus) Values() []TaskStatus { + return []TaskStatus{ + "RUNNING", + "FAILED", + "CANCELLING", + "CANCELLED", + "COMPLETED", + } +} diff --git a/service/sqs/types/errors.go b/service/sqs/types/errors.go index eb449d4764f..436fae9cd0f 100644 --- a/service/sqs/types/errors.go +++ b/service/sqs/types/errors.go @@ -27,7 +27,7 @@ func (e *BatchEntryIdsNotDistinct) ErrorMessage() string { } func (e *BatchEntryIdsNotDistinct) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" + return "BatchEntryIdsNotDistinct" } return *e.ErrorCodeOverride } @@ -53,7 +53,7 @@ func (e *BatchRequestTooLong) ErrorMessage() string { } func (e *BatchRequestTooLong) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.BatchRequestTooLong" + return "BatchRequestTooLong" } return *e.ErrorCodeOverride } @@ -79,12 +79,38 @@ func (e *EmptyBatchRequest) ErrorMessage() string { } func (e *EmptyBatchRequest) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.EmptyBatchRequest" + return "EmptyBatchRequest" } return *e.ErrorCodeOverride } func (e *EmptyBatchRequest) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The accountId is invalid. +type InvalidAddress struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidAddress) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidAddress) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidAddress) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAddress" + } + return *e.ErrorCodeOverride +} +func (e *InvalidAddress) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified attribute doesn't exist. type InvalidAttributeName struct { Message *string @@ -111,6 +137,32 @@ func (e *InvalidAttributeName) ErrorCode() string { } func (e *InvalidAttributeName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// A queue attribute value is invalid. +type InvalidAttributeValue struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidAttributeValue) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidAttributeValue) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidAttributeValue) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAttributeValue" + } + return *e.ErrorCodeOverride +} +func (e *InvalidAttributeValue) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The Id of a batch entry in a batch request doesn't abide by the specification. type InvalidBatchEntryId struct { Message *string @@ -131,7 +183,7 @@ func (e *InvalidBatchEntryId) ErrorMessage() string { } func (e *InvalidBatchEntryId) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.InvalidBatchEntryId" + return "InvalidBatchEntryId" } return *e.ErrorCodeOverride } @@ -189,6 +241,220 @@ func (e *InvalidMessageContents) ErrorCode() string { } func (e *InvalidMessageContents) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// When the request to a queue is not HTTPS and SigV4. +type InvalidSecurity struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidSecurity) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSecurity) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSecurity) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSecurity" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSecurity) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The caller doesn't have the required KMS access. +type KmsAccessDenied struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsAccessDenied) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsAccessDenied) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsAccessDenied) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsAccessDenied" + } + return *e.ErrorCodeOverride +} +func (e *KmsAccessDenied) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type KmsDisabled struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsDisabled) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsDisabled) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsDisabled) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsDisabled" + } + return *e.ErrorCodeOverride +} +func (e *KmsDisabled) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was rejected for one of the following reasons: +// - The KeyUsage value of the KMS key is incompatible with the API operation. +// - The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the KMS key (KeySpec). +type KmsInvalidKeyUsage struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsInvalidKeyUsage) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsInvalidKeyUsage) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsInvalidKeyUsage) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsInvalidKeyUsage" + } + return *e.ErrorCodeOverride +} +func (e *KmsInvalidKeyUsage) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was rejected because the state of the specified resource is not +// valid for this request. +type KmsInvalidState struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsInvalidState) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsInvalidState) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsInvalidState) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsInvalidState" + } + return *e.ErrorCodeOverride +} +func (e *KmsInvalidState) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was rejected because the specified entity or resource could not be +// found. +type KmsNotFound struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsNotFound) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsNotFound) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsNotFound) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsNotFound" + } + return *e.ErrorCodeOverride +} +func (e *KmsNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was rejected because the specified key policy isn't syntactically +// or semantically correct. +type KmsOptInRequired struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsOptInRequired) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsOptInRequired) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsOptInRequired) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsOptInRequired" + } + return *e.ErrorCodeOverride +} +func (e *KmsOptInRequired) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Amazon Web Services KMS throttles requests for the following conditions. +type KmsThrottled struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KmsThrottled) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KmsThrottled) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KmsThrottled) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KmsThrottled" + } + return *e.ErrorCodeOverride +} +func (e *KmsThrottled) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified message isn't in flight. type MessageNotInflight struct { Message *string @@ -209,7 +475,7 @@ func (e *MessageNotInflight) ErrorMessage() string { } func (e *MessageNotInflight) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.MessageNotInflight" + return "MessageNotInflight" } return *e.ErrorCodeOverride } @@ -266,7 +532,7 @@ func (e *PurgeQueueInProgress) ErrorMessage() string { } func (e *PurgeQueueInProgress) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.PurgeQueueInProgress" + return "PurgeQueueInProgress" } return *e.ErrorCodeOverride } @@ -293,7 +559,7 @@ func (e *QueueDeletedRecently) ErrorMessage() string { } func (e *QueueDeletedRecently) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.QueueDeletedRecently" + return "QueueDeletedRecently" } return *e.ErrorCodeOverride } @@ -319,7 +585,7 @@ func (e *QueueDoesNotExist) ErrorMessage() string { } func (e *QueueDoesNotExist) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.NonExistentQueue" + return "QueueDoesNotExist" } return *e.ErrorCodeOverride } @@ -347,7 +613,7 @@ func (e *QueueNameExists) ErrorMessage() string { } func (e *QueueNameExists) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "QueueAlreadyExists" + return "QueueNameExists" } return *e.ErrorCodeOverride } @@ -379,6 +645,41 @@ func (e *ReceiptHandleIsInvalid) ErrorCode() string { } func (e *ReceiptHandleIsInvalid) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request was denied due to request throttling. +// - The rate of requests per second exceeds the Amazon Web Services KMS request +// quota for an account and Region. +// - A burst or sustained high rate of requests to change the state of the same +// KMS key. This condition is often known as a "hot key." +// - Requests for operations on KMS keys in a Amazon Web Services CloudHSM key +// store might be throttled at a lower-than-expected rate when the Amazon Web +// Services CloudHSM cluster associated with the Amazon Web Services CloudHSM key +// store is processing numerous commands, including those unrelated to the Amazon +// Web Services CloudHSM key store. +type RequestThrottled struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RequestThrottled) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RequestThrottled) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RequestThrottled) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RequestThrottled" + } + return *e.ErrorCodeOverride +} +func (e *RequestThrottled) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // One or more specified resources don't exist. type ResourceNotFoundException struct { Message *string @@ -425,7 +726,7 @@ func (e *TooManyEntriesInBatchRequest) ErrorMessage() string { } func (e *TooManyEntriesInBatchRequest) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" + return "TooManyEntriesInBatchRequest" } return *e.ErrorCodeOverride } @@ -451,7 +752,7 @@ func (e *UnsupportedOperation) ErrorMessage() string { } func (e *UnsupportedOperation) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { - return "AWS.SimpleQueueService.UnsupportedOperation" + return "UnsupportedOperation" } return *e.ErrorCodeOverride } diff --git a/service/sqs/types/types.go b/service/sqs/types/types.go index aa848efe017..5b8d5d6750b 100644 --- a/service/sqs/types/types.go +++ b/service/sqs/types/types.go @@ -103,7 +103,7 @@ type ListMessageMoveTasksResultEntry struct { // The number of messages to be moved from the source queue. This number is // obtained at the time of starting the message movement task. - ApproximateNumberOfMessagesToMove int64 + ApproximateNumberOfMessagesToMove *int64 // The ARN of the destination queue if it has been specified in the // StartMessageMoveTask request. If a DestinationArn has not been specified in the @@ -117,7 +117,7 @@ type ListMessageMoveTasksResultEntry struct { // it has been specified in the StartMessageMoveTask request. If a // MaxNumberOfMessagesPerSecond has not been specified in the StartMessageMoveTask // request, this field value will be NULL. - MaxNumberOfMessagesPerSecond int32 + MaxNumberOfMessagesPerSecond *int32 // The ARN of the queue that contains the messages to be moved to another queue. SourceArn *string @@ -127,7 +127,7 @@ type ListMessageMoveTasksResultEntry struct { // The status of the message movement task. Possible values are: RUNNING, // COMPLETED, CANCELLING, CANCELLED, and FAILED. - Status *string + Status TaskStatus // An identifier associated with a message movement task. When this field is // returned in the response of the ListMessageMoveTasks action, it is only