From a5cc3a35a30a10b33e5ad212b11e69fa10f21c28 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Wed, 28 Sep 2022 21:09:27 +0000 Subject: [PATCH] fix(clients): populate message field when parsing errors --- .../src/protocols/Aws_restJson1.ts | 62 +- .../src/protocols/Aws_restJson1.ts | 16 +- .../src/protocols/Aws_json1_1.ts | 52 +- .../client-acm/src/protocols/Aws_json1_1.ts | 36 +- .../src/protocols/Aws_json1_1.ts | 192 +-- .../client-amp/src/protocols/Aws_restJson1.ts | 48 +- .../src/protocols/Aws_restJson1.ts | 80 +- .../src/protocols/Aws_restJson1.ts | 68 +- .../src/protocols/Aws_restJson1.ts | 50 +- .../src/protocols/Aws_restJson1.ts | 246 ++-- .../src/protocols/Aws_restJson1.ts | 12 +- .../src/protocols/Aws_restJson1.ts | 150 +-- .../src/protocols/Aws_restJson1.ts | 82 +- .../src/protocols/Aws_restJson1.ts | 92 +- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_restJson1.ts | 50 +- .../src/protocols/Aws_restJson1.ts | 36 +- .../src/protocols/Aws_json1_1.ts | 26 +- .../src/protocols/Aws_json1_1.ts | 56 +- .../src/protocols/Aws_json1_1.ts | 60 +- .../src/protocols/Aws_restJson1.ts | 18 +- .../src/protocols/Aws_json1_0.ts | 66 +- .../src/protocols/Aws_json1_1.ts | 136 +- .../src/protocols/Aws_restJson1.ts | 106 +- .../src/protocols/Aws_json1_1.ts | 80 +- .../src/protocols/Aws_restJson1.ts | 128 +- .../src/protocols/Aws_json1_1.ts | 18 +- .../src/protocols/Aws_query.ts | 128 +- .../src/protocols/Aws_json1_0.ts | 44 +- .../src/protocols/Aws_restJson1.ts | 138 ++- .../src/protocols/Aws_restJson1.ts | 24 +- .../src/protocols/Aws_restJson1.ts | 54 +- .../src/protocols/Aws_restJson1.ts | 66 +- .../src/protocols/Aws_restJson1.ts | 32 +- .../src/protocols/Aws_json1_1.ts | 52 +- .../src/protocols/Aws_restJson1.ts | 54 +- .../src/protocols/Aws_restJson1.ts | 30 +- .../src/protocols/Aws_restJson1.ts | 38 +- .../src/protocols/Aws_restJson1.ts | 100 +- .../src/protocols/Aws_restJson1.ts | 388 +++--- .../src/protocols/Aws_json1_1.ts | 32 +- .../src/protocols/Aws_json1_0.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 138 ++- .../src/protocols/Aws_query.ts | 138 ++- .../src/protocols/Aws_restXml.ts | 202 +-- .../src/protocols/Aws_json1_1.ts | 36 +- .../src/protocols/Aws_json1_1.ts | 46 +- .../src/protocols/Aws_restJson1.ts | 12 +- .../src/protocols/Aws_query.ts | 58 +- .../src/protocols/Aws_json1_1.ts | 78 +- .../src/protocols/Aws_json1_1.ts | 108 +- .../src/protocols/Aws_json1_1.ts | 90 +- .../src/protocols/Aws_query.ts | 82 +- .../src/protocols/Aws_restJson1.ts | 78 +- .../src/protocols/Aws_json1_1.ts | 96 +- .../src/protocols/Aws_json1_1.ts | 160 +-- .../src/protocols/Aws_json1_1.ts | 100 +- .../src/protocols/Aws_restJson1.ts | 34 +- .../src/protocols/Aws_restJson1.ts | 52 +- .../src/protocols/Aws_json1_1.ts | 84 +- .../src/protocols/Aws_json1_0.ts | 30 +- .../src/protocols/Aws_restJson1.ts | 32 +- .../src/protocols/Aws_json1_1.ts | 42 +- .../src/protocols/Aws_json1_1.ts | 208 ++-- .../src/protocols/Aws_json1_1.ts | 52 +- .../src/protocols/Aws_restJson1.ts | 40 +- .../src/protocols/Aws_json1_1.ts | 152 +-- .../src/protocols/Aws_json1_1.ts | 58 +- .../src/protocols/Aws_json1_0.ts | 42 +- .../src/protocols/Aws_json1_1.ts | 184 +-- .../src/protocols/Aws_restJson1.ts | 8 +- .../src/protocols/Aws_restJson1.ts | 314 ++--- .../src/protocols/Aws_restJson1.ts | 50 +- .../src/protocols/Aws_restJson1.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 14 +- .../src/protocols/Aws_json1_1.ts | 14 +- .../src/protocols/Aws_json1_1.ts | 76 +- .../src/protocols/Aws_restJson1.ts | 82 +- .../src/protocols/Aws_json1_1.ts | 44 +- .../src/protocols/Aws_json1_1.ts | 136 +- .../src/protocols/Aws_restJson1.ts | 94 +- .../src/protocols/Aws_restJson1.ts | 64 +- .../src/protocols/Aws_json1_1.ts | 94 +- .../client-dax/src/protocols/Aws_json1_1.ts | 48 +- .../src/protocols/Aws_restJson1.ts | 54 +- .../src/protocols/Aws_json1_1.ts | 160 +-- .../src/protocols/Aws_restJson1.ts | 68 +- .../src/protocols/Aws_json1_1.ts | 132 +- .../src/protocols/Aws_json1_1.ts | 136 +- .../client-dlm/src/protocols/Aws_restJson1.ts | 22 +- .../client-docdb/src/protocols/Aws_query.ts | 112 +- .../client-drs/src/protocols/Aws_restJson1.ts | 70 +- .../src/protocols/Aws_json1_0.ts | 14 +- .../src/protocols/Aws_json1_0.ts | 112 +- .../client-ebs/src/protocols/Aws_restJson1.ts | 18 +- .../src/protocols/Aws_json1_1.ts | 10 +- clients/client-ec2/src/protocols/Aws_ec2.ts | 1090 +++++++++-------- .../src/protocols/Aws_json1_1.ts | 52 +- .../client-ecr/src/protocols/Aws_json1_1.ts | 88 +- .../client-ecs/src/protocols/Aws_json1_1.ts | 110 +- .../client-efs/src/protocols/Aws_restJson1.ts | 66 +- .../client-eks/src/protocols/Aws_restJson1.ts | 74 +- .../src/protocols/Aws_query.ts | 100 +- .../src/protocols/Aws_restJson1.ts | 18 +- .../src/protocols/Aws_query.ts | 74 +- .../src/protocols/Aws_query.ts | 64 +- .../src/protocols/Aws_restJson1.ts | 40 +- .../src/protocols/Aws_query.ts | 136 +- .../src/protocols/Aws_restJson1.ts | 88 +- .../src/protocols/Aws_restJson1.ts | 36 +- .../src/protocols/Aws_restJson1.ts | 34 +- .../client-emr/src/protocols/Aws_json1_1.ts | 110 +- .../src/protocols/Aws_json1_1.ts | 118 +- .../src/protocols/Aws_restJson1.ts | 82 +- .../src/protocols/Aws_restJson1.ts | 68 +- .../src/protocols/Aws_restJson1.ts | 22 +- .../src/protocols/Aws_json1_1.ts | 30 +- .../client-fis/src/protocols/Aws_restJson1.ts | 38 +- .../client-fms/src/protocols/Aws_json1_1.ts | 66 +- .../src/protocols/Aws_json1_1.ts | 132 +- .../src/protocols/Aws_json1_1.ts | 10 +- .../src/protocols/Aws_json1_1.ts | 142 ++- .../client-fsx/src/protocols/Aws_json1_1.ts | 80 +- .../src/protocols/Aws_json1_1.ts | 196 +-- .../src/protocols/Aws_restJson1.ts | 72 +- .../src/protocols/Aws_restJson1.ts | 72 +- .../src/protocols/Aws_json1_1.ts | 100 +- .../client-glue/src/protocols/Aws_json1_1.ts | 374 +++--- .../src/protocols/Aws_restJson1.ts | 38 +- .../src/protocols/Aws_restJson1.ts | 190 +-- .../src/protocols/Aws_restJson1.ts | 64 +- .../src/protocols/Aws_restJson1.ts | 56 +- .../src/protocols/Aws_restJson1.ts | 136 +- .../src/protocols/Aws_json1_1.ts | 32 +- .../src/protocols/Aws_json1_0.ts | 32 +- .../src/protocols/Aws_restJson1.ts | 36 +- clients/client-iam/src/protocols/Aws_query.ts | 322 ++--- .../src/protocols/Aws_json1_1.ts | 44 +- .../src/protocols/Aws_restJson1.ts | 106 +- .../src/protocols/Aws_json1_1.ts | 80 +- .../src/protocols/Aws_restJson1.ts | 70 +- .../src/protocols/Aws_restJson1.ts | 32 +- .../src/protocols/Aws_restJson1.ts | 38 +- .../src/protocols/Aws_restJson1.ts | 20 +- .../src/protocols/Aws_restJson1.ts | 30 +- .../src/protocols/Aws_restJson1.ts | 58 +- .../src/protocols/Aws_restJson1.ts | 14 +- .../src/protocols/Aws_restJson1.ts | 202 +-- .../client-iot/src/protocols/Aws_restJson1.ts | 480 ++++---- .../src/protocols/Aws_restJson1.ts | 74 +- .../src/protocols/Aws_restJson1.ts | 34 +- .../src/protocols/Aws_restJson1.ts | 22 +- .../src/protocols/Aws_json1_0.ts | 106 +- .../src/protocols/Aws_json1_1.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 148 +-- .../src/protocols/Aws_json1_1.ts | 76 +- .../src/protocols/Aws_restJson1.ts | 58 +- .../client-ivs/src/protocols/Aws_restJson1.ts | 62 +- .../src/protocols/Aws_restJson1.ts | 30 +- .../src/protocols/Aws_restJson1.ts | 76 +- .../src/protocols/Aws_restJson1.ts | 30 +- .../src/protocols/Aws_json1_1.ts | 126 +- .../src/protocols/Aws_json1_0.ts | 32 +- .../src/protocols/Aws_json1_1.ts | 68 +- .../src/protocols/Aws_json1_1.ts | 46 +- .../src/protocols/Aws_restJson1.ts | 18 +- .../src/protocols/Aws_restJson1.ts | 8 +- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_restJson1.ts | 52 +- .../src/protocols/Aws_json1_1.ts | 64 +- .../client-kms/src/protocols/Aws_json1_1.ts | 106 +- .../src/protocols/Aws_restJson1.ts | 96 +- .../src/protocols/Aws_restJson1.ts | 132 +- .../src/protocols/Aws_restJson1.ts | 90 +- .../src/protocols/Aws_restJson1.ts | 140 ++- .../src/protocols/Aws_restJson1.ts | 16 +- .../src/protocols/Aws_restJson1.ts | 18 +- .../src/protocols/Aws_restJson1.ts | 26 +- .../src/protocols/Aws_json1_1.ts | 102 +- .../src/protocols/Aws_json1_1.ts | 316 ++--- .../src/protocols/Aws_restJson1.ts | 112 +- .../src/protocols/Aws_json1_0.ts | 72 +- .../src/protocols/Aws_restJson1.ts | 66 +- .../src/protocols/Aws_restJson1.ts | 50 +- .../client-m2/src/protocols/Aws_restJson1.ts | 70 +- .../src/protocols/Aws_json1_1.ts | 62 +- .../client-macie/src/protocols/Aws_json1_1.ts | 20 +- .../src/protocols/Aws_restJson1.ts | 138 ++- .../src/protocols/Aws_restJson1.ts | 52 +- .../src/protocols/Aws_restJson1.ts | 18 +- .../src/protocols/Aws_json1_1.ts | 10 +- .../src/protocols/Aws_json1_1.ts | 8 +- .../src/protocols/Aws_json1_1.ts | 14 +- .../src/protocols/Aws_restJson1.ts | 66 +- .../src/protocols/Aws_restJson1.ts | 62 +- .../src/protocols/Aws_restJson1.ts | 124 +- .../src/protocols/Aws_restJson1.ts | 40 +- .../src/protocols/Aws_restJson1.ts | 44 +- .../src/protocols/Aws_restJson1.ts | 16 +- .../src/protocols/Aws_json1_1.ts | 48 +- .../src/protocols/Aws_restJson1.ts | 90 +- .../src/protocols/Aws_json1_1.ts | 76 +- .../client-mgn/src/protocols/Aws_restJson1.ts | 72 +- .../src/protocols/Aws_restJson1.ts | 54 +- .../src/protocols/Aws_json1_1.ts | 40 +- .../src/protocols/Aws_json1_1.ts | 12 +- .../src/protocols/Aws_restJson1.ts | 46 +- .../src/protocols/Aws_restJson1.ts | 24 +- .../client-mq/src/protocols/Aws_restJson1.ts | 50 +- .../client-mturk/src/protocols/Aws_json1_1.ts | 84 +- .../src/protocols/Aws_restJson1.ts | 28 +- .../client-neptune/src/protocols/Aws_query.ts | 144 +-- .../src/protocols/Aws_json1_0.ts | 68 +- .../src/protocols/Aws_restJson1.ts | 176 +-- .../src/protocols/Aws_restJson1.ts | 100 +- .../src/protocols/Aws_restJson1.ts | 86 +- .../src/protocols/Aws_json1_1.ts | 154 +-- .../src/protocols/Aws_json1_1.ts | 44 +- .../src/protocols/Aws_json1_1.ts | 110 +- .../src/protocols/Aws_restJson1.ts | 58 +- .../src/protocols/Aws_restJson1.ts | 72 +- .../src/protocols/Aws_restJson1.ts | 12 +- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_json1_1.ts | 126 +- .../client-pi/src/protocols/Aws_json1_1.ts | 18 +- .../src/protocols/Aws_restJson1.ts | 90 +- .../src/protocols/Aws_json1_0.ts | 92 +- .../src/protocols/Aws_restJson1.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 244 ++-- .../src/protocols/Aws_restJson1.ts | 24 +- .../src/protocols/Aws_json1_1.ts | 12 +- .../src/protocols/Aws_restJson1.ts | 56 +- .../src/protocols/Aws_json1_0.ts | 156 +-- .../src/protocols/Aws_json1_0.ts | 8 +- .../src/protocols/Aws_restJson1.ts | 46 +- .../src/protocols/Aws_restJson1.ts | 246 ++-- .../client-ram/src/protocols/Aws_restJson1.ts | 56 +- .../src/protocols/Aws_restJson1.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 18 +- clients/client-rds/src/protocols/Aws_query.ts | 280 ++--- .../src/protocols/Aws_json1_1.ts | 26 +- .../src/protocols/Aws_json1_1.ts | 80 +- .../src/protocols/Aws_query.ts | 244 ++-- .../src/protocols/Aws_json1_1.ts | 132 +- .../src/protocols/Aws_restJson1.ts | 84 +- .../src/protocols/Aws_json1_1.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 38 +- .../src/protocols/Aws_restJson1.ts | 120 +- .../src/protocols/Aws_restJson1.ts | 58 +- .../src/protocols/Aws_json1_1.ts | 66 +- .../src/protocols/Aws_restXml.ts | 146 +-- .../src/protocols/Aws_json1_0.ts | 14 +- .../src/protocols/Aws_restJson1.ts | 52 +- .../src/protocols/Aws_restJson1.ts | 70 +- .../src/protocols/Aws_json1_1.ts | 132 +- .../client-rum/src/protocols/Aws_restJson1.ts | 26 +- .../src/protocols/Aws_restXml.ts | 124 +- .../client-s3/src/protocols/Aws_restXml.ts | 192 +-- .../src/protocols/Aws_restJson1.ts | 14 +- .../src/protocols/Aws_restJson1.ts | 16 +- .../src/protocols/Aws_restJson1.ts | 12 +- .../src/protocols/Aws_restJson1.ts | 14 +- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_json1_1.ts | 532 ++++---- .../src/protocols/Aws_restJson1.ts | 24 +- .../src/protocols/Aws_restJson1.ts | 68 +- .../src/protocols/Aws_json1_1.ts | 50 +- .../src/protocols/Aws_restJson1.ts | 118 +- .../src/protocols/Aws_restJson1.ts | 34 +- .../src/protocols/Aws_restJson1.ts | 50 +- .../src/protocols/Aws_json1_1.ts | 180 +-- .../src/protocols/Aws_json1_1.ts | 44 +- .../src/protocols/Aws_json1_1.ts | 58 +- clients/client-ses/src/protocols/Aws_query.ts | 148 +-- .../src/protocols/Aws_restJson1.ts | 168 +-- .../client-sfn/src/protocols/Aws_json1_0.ts | 52 +- .../src/protocols/Aws_json1_1.ts | 78 +- .../src/protocols/Aws_restJson1.ts | 40 +- .../client-sms/src/protocols/Aws_json1_1.ts | 76 +- .../src/protocols/Aws_restJson1.ts | 32 +- .../src/protocols/Aws_json1_1.ts | 56 +- clients/client-sns/src/protocols/Aws_query.ts | 90 +- clients/client-sqs/src/protocols/Aws_query.ts | 46 +- .../src/protocols/Aws_json1_1.ts | 60 +- .../src/protocols/Aws_restJson1.ts | 64 +- .../client-ssm/src/protocols/Aws_json1_1.ts | 276 +++-- .../src/protocols/Aws_json1_1.ts | 80 +- .../src/protocols/Aws_restJson1.ts | 12 +- .../client-sso/src/protocols/Aws_restJson1.ts | 14 +- .../src/protocols/Aws_json1_1.ts | 186 +-- clients/client-sts/src/protocols/Aws_query.ts | 22 +- .../src/protocols/Aws_restJson1.ts | 24 +- .../src/protocols/Aws_json1_1.ts | 34 +- .../client-swf/src/protocols/Aws_json1_0.ts | 80 +- .../src/protocols/Aws_restJson1.ts | 48 +- .../src/protocols/Aws_json1_1.ts | 26 +- .../src/protocols/Aws_json1_0.ts | 32 +- .../src/protocols/Aws_json1_0.ts | 36 +- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_json1_1.ts | 84 +- .../src/protocols/Aws_json1_1.ts | 122 +- .../src/protocols/Aws_json1_1.ts | 36 +- .../src/protocols/Aws_json1_0.ts | 48 +- .../src/protocols/Aws_json1_1.ts | 168 +-- .../client-waf/src/protocols/Aws_json1_1.ts | 160 +-- .../client-wafv2/src/protocols/Aws_json1_1.ts | 102 +- .../src/protocols/Aws_restJson1.ts | 86 +- .../src/protocols/Aws_restJson1.ts | 70 +- .../src/protocols/Aws_restJson1.ts | 88 +- .../src/protocols/Aws_restJson1.ts | 72 +- .../src/protocols/Aws_json1_1.ts | 152 +-- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_restJson1.ts | 94 +- .../src/protocols/Aws_json1_1.ts | 132 +- .../src/protocols/Aws_restJson1.ts | 60 +- .../src/protocols/Aws_restJson1.ts | 10 +- .../src/protocols/Aws_ec2.ts | 48 +- .../src/protocols/Aws_json1_0.ts | 24 +- .../src/protocols/Aws_json1_1.ts | 30 +- .../src/protocols/Aws_query.ts | 64 +- .../src/protocols/Aws_restJson1.ts | 178 +-- .../src/protocols/Aws_restXml.ts | 112 +- 322 files changed, 14192 insertions(+), 12260 deletions(-) diff --git a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts index 58c5fa7e76f7..b0486a48f627 100644 --- a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts +++ b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts @@ -948,7 +948,7 @@ const deserializeAws_restJson1ApplyArchiveRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -998,7 +998,7 @@ const deserializeAws_restJson1CancelPolicyGenerationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1048,7 +1048,7 @@ const deserializeAws_restJson1CreateAccessPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1107,7 +1107,7 @@ const deserializeAws_restJson1CreateAnalyzerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1160,7 +1160,7 @@ const deserializeAws_restJson1CreateArchiveRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1216,7 +1216,7 @@ const deserializeAws_restJson1DeleteAnalyzerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1266,7 +1266,7 @@ const deserializeAws_restJson1DeleteArchiveRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1319,7 +1319,7 @@ const deserializeAws_restJson1GetAccessPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1372,7 +1372,7 @@ const deserializeAws_restJson1GetAnalyzedResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1425,7 +1425,7 @@ const deserializeAws_restJson1GetAnalyzerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_restJson1GetArchiveRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_restJson1GetFindingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1587,7 +1587,7 @@ const deserializeAws_restJson1GetGeneratedPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1640,7 +1640,7 @@ const deserializeAws_restJson1ListAccessPreviewFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1699,7 +1699,7 @@ const deserializeAws_restJson1ListAccessPreviewsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1755,7 +1755,7 @@ const deserializeAws_restJson1ListAnalyzedResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1811,7 +1811,7 @@ const deserializeAws_restJson1ListAnalyzersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1864,7 +1864,7 @@ const deserializeAws_restJson1ListArchiveRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1917,7 +1917,7 @@ const deserializeAws_restJson1ListFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1973,7 +1973,7 @@ const deserializeAws_restJson1ListPolicyGenerationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2023,7 +2023,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2076,7 +2076,7 @@ const deserializeAws_restJson1StartPolicyGenerationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2129,7 +2129,7 @@ const deserializeAws_restJson1StartResourceScanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2179,7 +2179,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2229,7 +2229,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2279,7 +2279,7 @@ const deserializeAws_restJson1UpdateArchiveRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2329,7 +2329,7 @@ const deserializeAws_restJson1UpdateFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2385,7 +2385,7 @@ const deserializeAws_restJson1ValidatePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3835,6 +3835,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-account/src/protocols/Aws_restJson1.ts b/clients/client-account/src/protocols/Aws_restJson1.ts index 1b616d88e17b..bc4ef29cc10e 100644 --- a/clients/client-account/src/protocols/Aws_restJson1.ts +++ b/clients/client-account/src/protocols/Aws_restJson1.ts @@ -196,7 +196,7 @@ const deserializeAws_restJson1DeleteAlternateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -249,7 +249,7 @@ const deserializeAws_restJson1GetAlternateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -302,7 +302,7 @@ const deserializeAws_restJson1GetContactInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -352,7 +352,7 @@ const deserializeAws_restJson1PutAlternateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -399,7 +399,7 @@ const deserializeAws_restJson1PutContactInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -585,6 +585,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts index c0fcac72e6c3..71af55d33c71 100644 --- a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts @@ -484,7 +484,7 @@ const deserializeAws_json1_1CreateCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -534,7 +534,7 @@ const deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -587,7 +587,7 @@ const deserializeAws_json1_1CreatePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -640,7 +640,7 @@ const deserializeAws_json1_1DeleteCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -687,7 +687,7 @@ const deserializeAws_json1_1DeletePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -734,7 +734,7 @@ const deserializeAws_json1_1DeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -790,7 +790,7 @@ const deserializeAws_json1_1DescribeCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -834,7 +834,7 @@ const deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -881,7 +881,7 @@ const deserializeAws_json1_1GetCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_json1_1GetCertificateAuthorityCertificateCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -981,7 +981,7 @@ const deserializeAws_json1_1GetCertificateAuthorityCsrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1034,7 +1034,7 @@ const deserializeAws_json1_1GetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1081,7 +1081,7 @@ const deserializeAws_json1_1ImportCertificateAuthorityCertificateCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1146,7 +1146,7 @@ const deserializeAws_json1_1IssueCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1202,7 +1202,7 @@ const deserializeAws_json1_1ListCertificateAuthoritiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1243,7 +1243,7 @@ const deserializeAws_json1_1ListPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1296,7 +1296,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1340,7 +1340,7 @@ const deserializeAws_json1_1PutPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1396,7 +1396,7 @@ const deserializeAws_json1_1RestoreCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1440,7 +1440,7 @@ const deserializeAws_json1_1RevokeCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1502,7 +1502,7 @@ const deserializeAws_json1_1TagCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1552,7 +1552,7 @@ const deserializeAws_json1_1UntagCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1599,7 +1599,7 @@ const deserializeAws_json1_1UpdateCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2982,6 +2982,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-acm/src/protocols/Aws_json1_1.ts b/clients/client-acm/src/protocols/Aws_json1_1.ts index 8e187d5ad324..53cf2dde8f48 100644 --- a/clients/client-acm/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm/src/protocols/Aws_json1_1.ts @@ -327,7 +327,7 @@ const deserializeAws_json1_1AddTagsToCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -383,7 +383,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -430,7 +430,7 @@ const deserializeAws_json1_1DescribeCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -474,7 +474,7 @@ const deserializeAws_json1_1ExportCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -521,7 +521,7 @@ const deserializeAws_json1_1GetAccountConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -565,7 +565,7 @@ const deserializeAws_json1_1GetCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -612,7 +612,7 @@ const deserializeAws_json1_1ImportCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -671,7 +671,7 @@ const deserializeAws_json1_1ListCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -712,7 +712,7 @@ const deserializeAws_json1_1ListTagsForCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -753,7 +753,7 @@ const deserializeAws_json1_1PutAccountConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -800,7 +800,7 @@ const deserializeAws_json1_1RemoveTagsFromCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -853,7 +853,7 @@ const deserializeAws_json1_1RenewCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -897,7 +897,7 @@ const deserializeAws_json1_1RequestCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -953,7 +953,7 @@ const deserializeAws_json1_1ResendValidationEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1000,7 +1000,7 @@ const deserializeAws_json1_1UpdateCertificateOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1948,6 +1948,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts index f5537373fc57..6b3f6e929f59 100644 --- a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts @@ -1728,7 +1728,7 @@ const deserializeAws_json1_1ApproveSkillCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1775,7 +1775,7 @@ const deserializeAws_json1_1AssociateContactWithAddressBookCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1816,7 +1816,7 @@ const deserializeAws_json1_1AssociateDeviceWithNetworkProfileCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1863,7 +1863,7 @@ const deserializeAws_json1_1AssociateDeviceWithRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1910,7 +1910,7 @@ const deserializeAws_json1_1AssociateSkillGroupWithRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1951,7 +1951,7 @@ const deserializeAws_json1_1AssociateSkillWithSkillGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1998,7 +1998,7 @@ const deserializeAws_json1_1AssociateSkillWithUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2042,7 +2042,7 @@ const deserializeAws_json1_1CreateAddressBookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2086,7 +2086,7 @@ const deserializeAws_json1_1CreateBusinessReportScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2127,7 +2127,7 @@ const deserializeAws_json1_1CreateConferenceProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2168,7 +2168,7 @@ const deserializeAws_json1_1CreateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2212,7 +2212,7 @@ const deserializeAws_json1_1CreateGatewayGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2256,7 +2256,7 @@ const deserializeAws_json1_1CreateNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2309,7 +2309,7 @@ const deserializeAws_json1_1CreateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2356,7 +2356,7 @@ const deserializeAws_json1_1CreateRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2400,7 +2400,7 @@ const deserializeAws_json1_1CreateSkillGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2447,7 +2447,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2494,7 +2494,7 @@ const deserializeAws_json1_1DeleteAddressBookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2538,7 +2538,7 @@ const deserializeAws_json1_1DeleteBusinessReportScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2582,7 +2582,7 @@ const deserializeAws_json1_1DeleteConferenceProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2623,7 +2623,7 @@ const deserializeAws_json1_1DeleteContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2667,7 +2667,7 @@ const deserializeAws_json1_1DeleteDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2714,7 +2714,7 @@ const deserializeAws_json1_1DeleteDeviceUsageDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2761,7 +2761,7 @@ const deserializeAws_json1_1DeleteGatewayGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2802,7 +2802,7 @@ const deserializeAws_json1_1DeleteNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2849,7 +2849,7 @@ const deserializeAws_json1_1DeleteProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2893,7 +2893,7 @@ const deserializeAws_json1_1DeleteRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2937,7 +2937,7 @@ const deserializeAws_json1_1DeleteRoomSkillParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2978,7 +2978,7 @@ const deserializeAws_json1_1DeleteSkillAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3022,7 +3022,7 @@ const deserializeAws_json1_1DeleteSkillGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3066,7 +3066,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3110,7 +3110,7 @@ const deserializeAws_json1_1DisassociateContactFromAddressBookCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3145,7 +3145,7 @@ const deserializeAws_json1_1DisassociateDeviceFromRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3189,7 +3189,7 @@ const deserializeAws_json1_1DisassociateSkillFromSkillGroupCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3233,7 +3233,7 @@ const deserializeAws_json1_1DisassociateSkillFromUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3277,7 +3277,7 @@ const deserializeAws_json1_1DisassociateSkillGroupFromRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3318,7 +3318,7 @@ const deserializeAws_json1_1ForgetSmartHomeAppliancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3359,7 +3359,7 @@ const deserializeAws_json1_1GetAddressBookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3400,7 +3400,7 @@ const deserializeAws_json1_1GetConferencePreferenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3441,7 +3441,7 @@ const deserializeAws_json1_1GetConferenceProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3482,7 +3482,7 @@ const deserializeAws_json1_1GetContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3523,7 +3523,7 @@ const deserializeAws_json1_1GetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3564,7 +3564,7 @@ const deserializeAws_json1_1GetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3605,7 +3605,7 @@ const deserializeAws_json1_1GetGatewayGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3646,7 +3646,7 @@ const deserializeAws_json1_1GetInvitationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3687,7 +3687,7 @@ const deserializeAws_json1_1GetNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3731,7 +3731,7 @@ const deserializeAws_json1_1GetProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3772,7 +3772,7 @@ const deserializeAws_json1_1GetRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3813,7 +3813,7 @@ const deserializeAws_json1_1GetRoomSkillParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3854,7 +3854,7 @@ const deserializeAws_json1_1GetSkillGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3895,7 +3895,7 @@ const deserializeAws_json1_1ListBusinessReportSchedulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3930,7 +3930,7 @@ const deserializeAws_json1_1ListConferenceProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3965,7 +3965,7 @@ const deserializeAws_json1_1ListDeviceEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4006,7 +4006,7 @@ const deserializeAws_json1_1ListGatewayGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4041,7 +4041,7 @@ const deserializeAws_json1_1ListGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4076,7 +4076,7 @@ const deserializeAws_json1_1ListSkillsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4111,7 +4111,7 @@ const deserializeAws_json1_1ListSkillsStoreCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4146,7 +4146,7 @@ const deserializeAws_json1_1ListSkillsStoreSkillsByCategoryCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4181,7 +4181,7 @@ const deserializeAws_json1_1ListSmartHomeAppliancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4222,7 +4222,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4263,7 +4263,7 @@ const deserializeAws_json1_1PutConferencePreferenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4304,7 +4304,7 @@ const deserializeAws_json1_1PutInvitationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4348,7 +4348,7 @@ const deserializeAws_json1_1PutRoomSkillParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4389,7 +4389,7 @@ const deserializeAws_json1_1PutSkillAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4433,7 +4433,7 @@ const deserializeAws_json1_1RegisterAVSDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4483,7 +4483,7 @@ const deserializeAws_json1_1RejectSkillCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4527,7 +4527,7 @@ const deserializeAws_json1_1ResolveRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4568,7 +4568,7 @@ const deserializeAws_json1_1RevokeInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4612,7 +4612,7 @@ const deserializeAws_json1_1SearchAddressBooksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4647,7 +4647,7 @@ const deserializeAws_json1_1SearchContactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4682,7 +4682,7 @@ const deserializeAws_json1_1SearchDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4717,7 +4717,7 @@ const deserializeAws_json1_1SearchNetworkProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4752,7 +4752,7 @@ const deserializeAws_json1_1SearchProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4787,7 +4787,7 @@ const deserializeAws_json1_1SearchRoomsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4822,7 +4822,7 @@ const deserializeAws_json1_1SearchSkillGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4857,7 +4857,7 @@ const deserializeAws_json1_1SearchUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4892,7 +4892,7 @@ const deserializeAws_json1_1SendAnnouncementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4936,7 +4936,7 @@ const deserializeAws_json1_1SendInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4983,7 +4983,7 @@ const deserializeAws_json1_1StartDeviceSyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5024,7 +5024,7 @@ const deserializeAws_json1_1StartSmartHomeApplianceDiscoveryCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5065,7 +5065,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5106,7 +5106,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5147,7 +5147,7 @@ const deserializeAws_json1_1UpdateAddressBookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5194,7 +5194,7 @@ const deserializeAws_json1_1UpdateBusinessReportScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5238,7 +5238,7 @@ const deserializeAws_json1_1UpdateConferenceProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5279,7 +5279,7 @@ const deserializeAws_json1_1UpdateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5323,7 +5323,7 @@ const deserializeAws_json1_1UpdateDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5370,7 +5370,7 @@ const deserializeAws_json1_1UpdateGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5414,7 +5414,7 @@ const deserializeAws_json1_1UpdateGatewayGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5458,7 +5458,7 @@ const deserializeAws_json1_1UpdateNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5511,7 +5511,7 @@ const deserializeAws_json1_1UpdateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5558,7 +5558,7 @@ const deserializeAws_json1_1UpdateRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5602,7 +5602,7 @@ const deserializeAws_json1_1UpdateSkillGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8869,6 +8869,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-amp/src/protocols/Aws_restJson1.ts b/clients/client-amp/src/protocols/Aws_restJson1.ts index 166ad58f964e..14cf0309f25f 100644 --- a/clients/client-amp/src/protocols/Aws_restJson1.ts +++ b/clients/client-amp/src/protocols/Aws_restJson1.ts @@ -665,7 +665,7 @@ const deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -724,7 +724,7 @@ const deserializeAws_restJson1CreateLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -783,7 +783,7 @@ const deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -851,7 +851,7 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -904,7 +904,7 @@ const deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -957,7 +957,7 @@ const deserializeAws_restJson1DeleteLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1007,7 +1007,7 @@ const deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1060,7 +1060,7 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1119,7 +1119,7 @@ const deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1175,7 +1175,7 @@ const deserializeAws_restJson1DescribeLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1228,7 +1228,7 @@ const deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1281,7 +1281,7 @@ const deserializeAws_restJson1DescribeWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1340,7 +1340,7 @@ const deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1393,7 +1393,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1449,7 +1449,7 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1499,7 +1499,7 @@ const deserializeAws_restJson1PutAlertManagerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1567,7 +1567,7 @@ const deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1623,7 +1623,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1673,7 +1673,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1726,7 +1726,7 @@ const deserializeAws_restJson1UpdateLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1776,7 +1776,7 @@ const deserializeAws_restJson1UpdateWorkspaceAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2208,6 +2208,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-amplify/src/protocols/Aws_restJson1.ts b/clients/client-amplify/src/protocols/Aws_restJson1.ts index 135d85e87fcb..e6f9dcfa0d82 100644 --- a/clients/client-amplify/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplify/src/protocols/Aws_restJson1.ts @@ -1162,7 +1162,7 @@ const deserializeAws_restJson1CreateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1215,7 +1215,7 @@ const deserializeAws_restJson1CreateBackendEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1268,7 +1268,7 @@ const deserializeAws_restJson1CreateBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1330,7 +1330,7 @@ const deserializeAws_restJson1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1380,7 +1380,7 @@ const deserializeAws_restJson1CreateDomainAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1436,7 +1436,7 @@ const deserializeAws_restJson1CreateWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1492,7 +1492,7 @@ const deserializeAws_restJson1DeleteAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1545,7 +1545,7 @@ const deserializeAws_restJson1DeleteBackendEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1598,7 +1598,7 @@ const deserializeAws_restJson1DeleteBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1651,7 +1651,7 @@ const deserializeAws_restJson1DeleteDomainAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1704,7 +1704,7 @@ const deserializeAws_restJson1DeleteJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1757,7 +1757,7 @@ const deserializeAws_restJson1DeleteWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1810,7 +1810,7 @@ const deserializeAws_restJson1GenerateAccessLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1860,7 +1860,7 @@ const deserializeAws_restJson1GetAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1913,7 +1913,7 @@ const deserializeAws_restJson1GetArtifactUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1966,7 +1966,7 @@ const deserializeAws_restJson1GetBackendEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2016,7 +2016,7 @@ const deserializeAws_restJson1GetBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2066,7 +2066,7 @@ const deserializeAws_restJson1GetDomainAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2116,7 +2116,7 @@ const deserializeAws_restJson1GetJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2169,7 +2169,7 @@ const deserializeAws_restJson1GetWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2225,7 +2225,7 @@ const deserializeAws_restJson1ListAppsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_restJson1ListArtifactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2328,7 +2328,7 @@ const deserializeAws_restJson1ListBackendEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2378,7 +2378,7 @@ const deserializeAws_restJson1ListBranchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2428,7 +2428,7 @@ const deserializeAws_restJson1ListDomainAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2478,7 +2478,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2528,7 +2528,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2578,7 +2578,7 @@ const deserializeAws_restJson1ListWebhooksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2628,7 +2628,7 @@ const deserializeAws_restJson1StartDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2681,7 +2681,7 @@ const deserializeAws_restJson1StartJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2734,7 +2734,7 @@ const deserializeAws_restJson1StopJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2784,7 +2784,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2828,7 +2828,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2875,7 +2875,7 @@ const deserializeAws_restJson1UpdateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2925,7 +2925,7 @@ const deserializeAws_restJson1UpdateBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2978,7 +2978,7 @@ const deserializeAws_restJson1UpdateDomainAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3031,7 +3031,7 @@ const deserializeAws_restJson1UpdateWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3770,6 +3770,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts index 0f9b25bf521f..d254c7633d9d 100644 --- a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts @@ -1140,7 +1140,7 @@ const deserializeAws_restJson1CloneBackendCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1205,7 +1205,7 @@ const deserializeAws_restJson1CreateBackendCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1270,7 +1270,7 @@ const deserializeAws_restJson1CreateBackendAPICommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1335,7 +1335,7 @@ const deserializeAws_restJson1CreateBackendAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1394,7 +1394,7 @@ const deserializeAws_restJson1CreateBackendConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1453,7 +1453,7 @@ const deserializeAws_restJson1CreateBackendStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1512,7 +1512,7 @@ const deserializeAws_restJson1CreateTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1577,7 +1577,7 @@ const deserializeAws_restJson1DeleteBackendCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1642,7 +1642,7 @@ const deserializeAws_restJson1DeleteBackendAPICommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1707,7 +1707,7 @@ const deserializeAws_restJson1DeleteBackendAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1766,7 +1766,7 @@ const deserializeAws_restJson1DeleteBackendStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1816,7 +1816,7 @@ const deserializeAws_restJson1DeleteTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1881,7 +1881,7 @@ const deserializeAws_restJson1GenerateBackendAPIModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1949,7 +1949,7 @@ const deserializeAws_restJson1GetBackendCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2011,7 +2011,7 @@ const deserializeAws_restJson1GetBackendAPICommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2064,7 +2064,7 @@ const deserializeAws_restJson1GetBackendAPIModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2126,7 +2126,7 @@ const deserializeAws_restJson1GetBackendAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2197,7 +2197,7 @@ const deserializeAws_restJson1GetBackendJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2256,7 +2256,7 @@ const deserializeAws_restJson1GetBackendStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2315,7 +2315,7 @@ const deserializeAws_restJson1GetTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2380,7 +2380,7 @@ const deserializeAws_restJson1ImportBackendAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2439,7 +2439,7 @@ const deserializeAws_restJson1ImportBackendStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2492,7 +2492,7 @@ const deserializeAws_restJson1ListBackendJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2545,7 +2545,7 @@ const deserializeAws_restJson1ListS3BucketsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2607,7 +2607,7 @@ const deserializeAws_restJson1RemoveAllBackendsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2657,7 +2657,7 @@ const deserializeAws_restJson1RemoveBackendConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2722,7 +2722,7 @@ const deserializeAws_restJson1UpdateBackendAPICommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2787,7 +2787,7 @@ const deserializeAws_restJson1UpdateBackendAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2846,7 +2846,7 @@ const deserializeAws_restJson1UpdateBackendConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2917,7 +2917,7 @@ const deserializeAws_restJson1UpdateBackendJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2976,7 +2976,7 @@ const deserializeAws_restJson1UpdateBackendStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4068,6 +4068,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts index 3bd48338f738..e3c08d7fff29 100644 --- a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts @@ -906,7 +906,7 @@ const deserializeAws_restJson1CreateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -954,7 +954,7 @@ const deserializeAws_restJson1CreateFormCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1002,7 +1002,7 @@ const deserializeAws_restJson1CreateThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1049,7 +1049,7 @@ const deserializeAws_restJson1DeleteComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1093,7 +1093,7 @@ const deserializeAws_restJson1DeleteFormCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_restJson1DeleteThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1190,7 +1190,7 @@ const deserializeAws_restJson1ExchangeCodeForTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1234,7 +1234,7 @@ const deserializeAws_restJson1ExportComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1281,7 +1281,7 @@ const deserializeAws_restJson1ExportFormsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1328,7 +1328,7 @@ const deserializeAws_restJson1ExportThemesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1370,7 +1370,7 @@ const deserializeAws_restJson1GetComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1415,7 +1415,7 @@ const deserializeAws_restJson1GetFormCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1462,7 +1462,7 @@ const deserializeAws_restJson1GetMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1504,7 +1504,7 @@ const deserializeAws_restJson1GetThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1554,7 +1554,7 @@ const deserializeAws_restJson1ListComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1601,7 +1601,7 @@ const deserializeAws_restJson1ListFormsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1648,7 +1648,7 @@ const deserializeAws_restJson1ListThemesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1689,7 +1689,7 @@ const deserializeAws_restJson1PutMetadataFlagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1736,7 +1736,7 @@ const deserializeAws_restJson1RefreshTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1775,7 +1775,7 @@ const deserializeAws_restJson1UpdateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1820,7 +1820,7 @@ const deserializeAws_restJson1UpdateFormCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1865,7 +1865,7 @@ const deserializeAws_restJson1UpdateThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3529,6 +3529,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts index 9a6f48a49aae..1fe4ba8713af 100644 --- a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts +++ b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts @@ -3752,7 +3752,7 @@ const deserializeAws_restJson1CreateApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3835,7 +3835,7 @@ const deserializeAws_restJson1CreateAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3897,7 +3897,7 @@ const deserializeAws_restJson1CreateBasePathMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3962,7 +3962,7 @@ const deserializeAws_restJson1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4027,7 +4027,7 @@ const deserializeAws_restJson1CreateDocumentationPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4089,7 +4089,7 @@ const deserializeAws_restJson1CreateDocumentationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4196,7 +4196,7 @@ const deserializeAws_restJson1CreateDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4261,7 +4261,7 @@ const deserializeAws_restJson1CreateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4326,7 +4326,7 @@ const deserializeAws_restJson1CreateRequestValidatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4394,7 +4394,7 @@ const deserializeAws_restJson1CreateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4486,7 +4486,7 @@ const deserializeAws_restJson1CreateRestApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4587,7 +4587,7 @@ const deserializeAws_restJson1CreateStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4664,7 +4664,7 @@ const deserializeAws_restJson1CreateUsagePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4729,7 +4729,7 @@ const deserializeAws_restJson1CreateUsagePlanKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4803,7 +4803,7 @@ const deserializeAws_restJson1CreateVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4853,7 +4853,7 @@ const deserializeAws_restJson1DeleteApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4903,7 +4903,7 @@ const deserializeAws_restJson1DeleteAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4953,7 +4953,7 @@ const deserializeAws_restJson1DeleteBasePathMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5003,7 +5003,7 @@ const deserializeAws_restJson1DeleteClientCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5053,7 +5053,7 @@ const deserializeAws_restJson1DeleteDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5106,7 +5106,7 @@ const deserializeAws_restJson1DeleteDocumentationPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5156,7 +5156,7 @@ const deserializeAws_restJson1DeleteDocumentationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5206,7 +5206,7 @@ const deserializeAws_restJson1DeleteDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5256,7 +5256,7 @@ const deserializeAws_restJson1DeleteGatewayResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5306,7 +5306,7 @@ const deserializeAws_restJson1DeleteIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5356,7 +5356,7 @@ const deserializeAws_restJson1DeleteIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5406,7 +5406,7 @@ const deserializeAws_restJson1DeleteMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5453,7 +5453,7 @@ const deserializeAws_restJson1DeleteMethodResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5503,7 +5503,7 @@ const deserializeAws_restJson1DeleteModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5553,7 +5553,7 @@ const deserializeAws_restJson1DeleteRequestValidatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5603,7 +5603,7 @@ const deserializeAws_restJson1DeleteResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5653,7 +5653,7 @@ const deserializeAws_restJson1DeleteRestApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5703,7 +5703,7 @@ const deserializeAws_restJson1DeleteStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5756,7 +5756,7 @@ const deserializeAws_restJson1DeleteUsagePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5806,7 +5806,7 @@ const deserializeAws_restJson1DeleteUsagePlanKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5856,7 +5856,7 @@ const deserializeAws_restJson1DeleteVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5906,7 +5906,7 @@ const deserializeAws_restJson1FlushStageAuthorizersCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5959,7 +5959,7 @@ const deserializeAws_restJson1FlushStageCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6030,7 +6030,7 @@ const deserializeAws_restJson1GenerateClientCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6092,7 +6092,7 @@ const deserializeAws_restJson1GetAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6169,7 +6169,7 @@ const deserializeAws_restJson1GetApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6225,7 +6225,7 @@ const deserializeAws_restJson1GetApiKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6302,7 +6302,7 @@ const deserializeAws_restJson1GetAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6355,7 +6355,7 @@ const deserializeAws_restJson1GetAuthorizersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6411,7 +6411,7 @@ const deserializeAws_restJson1GetBasePathMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6464,7 +6464,7 @@ const deserializeAws_restJson1GetBasePathMappingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6529,7 +6529,7 @@ const deserializeAws_restJson1GetClientCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6582,7 +6582,7 @@ const deserializeAws_restJson1GetClientCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6641,7 +6641,7 @@ const deserializeAws_restJson1GetDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6697,7 +6697,7 @@ const deserializeAws_restJson1GetDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6756,7 +6756,7 @@ const deserializeAws_restJson1GetDocumentationPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6809,7 +6809,7 @@ const deserializeAws_restJson1GetDocumentationPartsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6865,7 +6865,7 @@ const deserializeAws_restJson1GetDocumentationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6915,7 +6915,7 @@ const deserializeAws_restJson1GetDocumentationVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7016,7 +7016,7 @@ const deserializeAws_restJson1GetDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7069,7 +7069,7 @@ const deserializeAws_restJson1GetDomainNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7119,7 +7119,7 @@ const deserializeAws_restJson1GetExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7187,7 +7187,7 @@ const deserializeAws_restJson1GetGatewayResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7240,7 +7240,7 @@ const deserializeAws_restJson1GetGatewayResponsesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7335,7 +7335,7 @@ const deserializeAws_restJson1GetIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7397,7 +7397,7 @@ const deserializeAws_restJson1GetIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7477,7 +7477,7 @@ const deserializeAws_restJson1GetMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7530,7 +7530,7 @@ const deserializeAws_restJson1GetMethodResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7589,7 +7589,7 @@ const deserializeAws_restJson1GetModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7642,7 +7642,7 @@ const deserializeAws_restJson1GetModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7692,7 +7692,7 @@ const deserializeAws_restJson1GetModelTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7751,7 +7751,7 @@ const deserializeAws_restJson1GetRequestValidatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7804,7 +7804,7 @@ const deserializeAws_restJson1GetRequestValidatorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7866,7 +7866,7 @@ const deserializeAws_restJson1GetResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7916,7 +7916,7 @@ const deserializeAws_restJson1GetResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8002,7 +8002,7 @@ const deserializeAws_restJson1GetRestApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8055,7 +8055,7 @@ const deserializeAws_restJson1GetRestApisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8105,7 +8105,7 @@ const deserializeAws_restJson1GetSdkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8173,7 +8173,7 @@ const deserializeAws_restJson1GetSdkTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8223,7 +8223,7 @@ const deserializeAws_restJson1GetSdkTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8321,7 +8321,7 @@ const deserializeAws_restJson1GetStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8377,7 +8377,7 @@ const deserializeAws_restJson1GetStagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8433,7 +8433,7 @@ const deserializeAws_restJson1GetTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8495,7 +8495,7 @@ const deserializeAws_restJson1GetUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8566,7 +8566,7 @@ const deserializeAws_restJson1GetUsagePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8625,7 +8625,7 @@ const deserializeAws_restJson1GetUsagePlanKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8678,7 +8678,7 @@ const deserializeAws_restJson1GetUsagePlanKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8731,7 +8731,7 @@ const deserializeAws_restJson1GetUsagePlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8799,7 +8799,7 @@ const deserializeAws_restJson1GetVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8852,7 +8852,7 @@ const deserializeAws_restJson1GetVpcLinksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8905,7 +8905,7 @@ const deserializeAws_restJson1ImportApiKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8964,7 +8964,7 @@ const deserializeAws_restJson1ImportDocumentationPartsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9056,7 +9056,7 @@ const deserializeAws_restJson1ImportRestApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9124,7 +9124,7 @@ const deserializeAws_restJson1PutGatewayResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9225,7 +9225,7 @@ const deserializeAws_restJson1PutIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9293,7 +9293,7 @@ const deserializeAws_restJson1PutIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9379,7 +9379,7 @@ const deserializeAws_restJson1PutMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9441,7 +9441,7 @@ const deserializeAws_restJson1PutMethodResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9533,7 +9533,7 @@ const deserializeAws_restJson1PutRestApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9586,7 +9586,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9660,7 +9660,7 @@ const deserializeAws_restJson1TestInvokeAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9725,7 +9725,7 @@ const deserializeAws_restJson1TestInvokeMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9772,7 +9772,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9837,7 +9837,7 @@ const deserializeAws_restJson1UpdateAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9920,7 +9920,7 @@ const deserializeAws_restJson1UpdateApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10003,7 +10003,7 @@ const deserializeAws_restJson1UpdateAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10065,7 +10065,7 @@ const deserializeAws_restJson1UpdateBasePathMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10136,7 +10136,7 @@ const deserializeAws_restJson1UpdateClientCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10201,7 +10201,7 @@ const deserializeAws_restJson1UpdateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10266,7 +10266,7 @@ const deserializeAws_restJson1UpdateDocumentationPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10328,7 +10328,7 @@ const deserializeAws_restJson1UpdateDocumentationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10435,7 +10435,7 @@ const deserializeAws_restJson1UpdateDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10503,7 +10503,7 @@ const deserializeAws_restJson1UpdateGatewayResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10604,7 +10604,7 @@ const deserializeAws_restJson1UpdateIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10672,7 +10672,7 @@ const deserializeAws_restJson1UpdateIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10758,7 +10758,7 @@ const deserializeAws_restJson1UpdateMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10817,7 +10817,7 @@ const deserializeAws_restJson1UpdateMethodResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10885,7 +10885,7 @@ const deserializeAws_restJson1UpdateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10950,7 +10950,7 @@ const deserializeAws_restJson1UpdateRequestValidatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11018,7 +11018,7 @@ const deserializeAws_restJson1UpdateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11107,7 +11107,7 @@ const deserializeAws_restJson1UpdateRestApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11211,7 +11211,7 @@ const deserializeAws_restJson1UpdateStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11279,7 +11279,7 @@ const deserializeAws_restJson1UpdateUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11356,7 +11356,7 @@ const deserializeAws_restJson1UpdateUsagePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11430,7 +11430,7 @@ const deserializeAws_restJson1UpdateVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12783,6 +12783,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts index ce3ae9adb39b..137c5a32adfe 100644 --- a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts @@ -137,7 +137,7 @@ const deserializeAws_restJson1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -190,7 +190,7 @@ const deserializeAws_restJson1GetConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -234,7 +234,7 @@ const deserializeAws_restJson1PostToConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -358,6 +358,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts index e1c50402afe3..0388c1dbe687 100644 --- a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts @@ -2423,7 +2423,7 @@ const deserializeAws_restJson1CreateApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2482,7 +2482,7 @@ const deserializeAws_restJson1CreateApiMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2562,7 +2562,7 @@ const deserializeAws_restJson1CreateAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2627,7 +2627,7 @@ const deserializeAws_restJson1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2695,7 +2695,7 @@ const deserializeAws_restJson1CreateDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2805,7 +2805,7 @@ const deserializeAws_restJson1CreateIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2870,7 +2870,7 @@ const deserializeAws_restJson1CreateIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2932,7 +2932,7 @@ const deserializeAws_restJson1CreateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3018,7 +3018,7 @@ const deserializeAws_restJson1CreateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3080,7 +3080,7 @@ const deserializeAws_restJson1CreateRouteResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3169,7 +3169,7 @@ const deserializeAws_restJson1CreateStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3243,7 +3243,7 @@ const deserializeAws_restJson1CreateVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3284,7 +3284,7 @@ const deserializeAws_restJson1DeleteAccessLogSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3325,7 +3325,7 @@ const deserializeAws_restJson1DeleteApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3366,7 +3366,7 @@ const deserializeAws_restJson1DeleteApiMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3410,7 +3410,7 @@ const deserializeAws_restJson1DeleteAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3451,7 +3451,7 @@ const deserializeAws_restJson1DeleteCorsConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3492,7 +3492,7 @@ const deserializeAws_restJson1DeleteDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3533,7 +3533,7 @@ const deserializeAws_restJson1DeleteDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3574,7 +3574,7 @@ const deserializeAws_restJson1DeleteIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3615,7 +3615,7 @@ const deserializeAws_restJson1DeleteIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3656,7 +3656,7 @@ const deserializeAws_restJson1DeleteModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3697,7 +3697,7 @@ const deserializeAws_restJson1DeleteRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3738,7 +3738,7 @@ const deserializeAws_restJson1DeleteRouteRequestParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3779,7 +3779,7 @@ const deserializeAws_restJson1DeleteRouteResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3820,7 +3820,7 @@ const deserializeAws_restJson1DeleteRouteSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3861,7 +3861,7 @@ const deserializeAws_restJson1DeleteStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3902,7 +3902,7 @@ const deserializeAws_restJson1DeleteVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3944,7 +3944,7 @@ const deserializeAws_restJson1ExportApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4036,7 +4036,7 @@ const deserializeAws_restJson1GetApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4089,7 +4089,7 @@ const deserializeAws_restJson1GetApiMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4139,7 +4139,7 @@ const deserializeAws_restJson1GetApiMappingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4189,7 +4189,7 @@ const deserializeAws_restJson1GetApisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4266,7 +4266,7 @@ const deserializeAws_restJson1GetAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4313,7 +4313,7 @@ const deserializeAws_restJson1GetAuthorizersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4375,7 +4375,7 @@ const deserializeAws_restJson1GetDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4422,7 +4422,7 @@ const deserializeAws_restJson1GetDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4487,7 +4487,7 @@ const deserializeAws_restJson1GetDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4534,7 +4534,7 @@ const deserializeAws_restJson1GetDomainNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4638,7 +4638,7 @@ const deserializeAws_restJson1GetIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4697,7 +4697,7 @@ const deserializeAws_restJson1GetIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4744,7 +4744,7 @@ const deserializeAws_restJson1GetIntegrationResponsesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4794,7 +4794,7 @@ const deserializeAws_restJson1GetIntegrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4853,7 +4853,7 @@ const deserializeAws_restJson1GetModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4900,7 +4900,7 @@ const deserializeAws_restJson1GetModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4947,7 +4947,7 @@ const deserializeAws_restJson1GetModelTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5027,7 +5027,7 @@ const deserializeAws_restJson1GetRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5083,7 +5083,7 @@ const deserializeAws_restJson1GetRouteResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5130,7 +5130,7 @@ const deserializeAws_restJson1GetRouteResponsesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5180,7 +5180,7 @@ const deserializeAws_restJson1GetRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5266,7 +5266,7 @@ const deserializeAws_restJson1GetStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5313,7 +5313,7 @@ const deserializeAws_restJson1GetStagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5360,7 +5360,7 @@ const deserializeAws_restJson1GetTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5434,7 +5434,7 @@ const deserializeAws_restJson1GetVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5481,7 +5481,7 @@ const deserializeAws_restJson1GetVpcLinksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5570,7 +5570,7 @@ const deserializeAws_restJson1ImportApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5665,7 +5665,7 @@ const deserializeAws_restJson1ReimportApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5712,7 +5712,7 @@ const deserializeAws_restJson1ResetAuthorizersCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5753,7 +5753,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5800,7 +5800,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5895,7 +5895,7 @@ const deserializeAws_restJson1UpdateApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5954,7 +5954,7 @@ const deserializeAws_restJson1UpdateApiMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6034,7 +6034,7 @@ const deserializeAws_restJson1UpdateAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6099,7 +6099,7 @@ const deserializeAws_restJson1UpdateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6167,7 +6167,7 @@ const deserializeAws_restJson1UpdateDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6274,7 +6274,7 @@ const deserializeAws_restJson1UpdateIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6339,7 +6339,7 @@ const deserializeAws_restJson1UpdateIntegrationResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6401,7 +6401,7 @@ const deserializeAws_restJson1UpdateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6487,7 +6487,7 @@ const deserializeAws_restJson1UpdateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6549,7 +6549,7 @@ const deserializeAws_restJson1UpdateRouteResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6638,7 +6638,7 @@ const deserializeAws_restJson1UpdateStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6712,7 +6712,7 @@ const deserializeAws_restJson1UpdateVpcLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7803,6 +7803,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts index 01ffc2b64f94..6d61a8f4f40b 100644 --- a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts +++ b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts @@ -1573,7 +1573,7 @@ const deserializeAws_restJson1CreateGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1633,7 +1633,7 @@ const deserializeAws_restJson1CreateMeshCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1693,7 +1693,7 @@ const deserializeAws_restJson1CreateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1753,7 +1753,7 @@ const deserializeAws_restJson1CreateVirtualGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1813,7 +1813,7 @@ const deserializeAws_restJson1CreateVirtualNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1873,7 +1873,7 @@ const deserializeAws_restJson1CreateVirtualRouterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1933,7 +1933,7 @@ const deserializeAws_restJson1CreateVirtualServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1993,7 +1993,7 @@ const deserializeAws_restJson1DeleteGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2050,7 +2050,7 @@ const deserializeAws_restJson1DeleteMeshCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2107,7 +2107,7 @@ const deserializeAws_restJson1DeleteRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2164,7 +2164,7 @@ const deserializeAws_restJson1DeleteVirtualGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2221,7 +2221,7 @@ const deserializeAws_restJson1DeleteVirtualNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2278,7 +2278,7 @@ const deserializeAws_restJson1DeleteVirtualRouterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2335,7 +2335,7 @@ const deserializeAws_restJson1DeleteVirtualServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2392,7 +2392,7 @@ const deserializeAws_restJson1DescribeGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2446,7 +2446,7 @@ const deserializeAws_restJson1DescribeMeshCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2500,7 +2500,7 @@ const deserializeAws_restJson1DescribeRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2554,7 +2554,7 @@ const deserializeAws_restJson1DescribeVirtualGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2608,7 +2608,7 @@ const deserializeAws_restJson1DescribeVirtualNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2662,7 +2662,7 @@ const deserializeAws_restJson1DescribeVirtualRouterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2716,7 +2716,7 @@ const deserializeAws_restJson1DescribeVirtualServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2775,7 +2775,7 @@ const deserializeAws_restJson1ListGatewayRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2834,7 +2834,7 @@ const deserializeAws_restJson1ListMeshesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2893,7 +2893,7 @@ const deserializeAws_restJson1ListRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2952,7 +2952,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3011,7 +3011,7 @@ const deserializeAws_restJson1ListVirtualGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3070,7 +3070,7 @@ const deserializeAws_restJson1ListVirtualNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3129,7 +3129,7 @@ const deserializeAws_restJson1ListVirtualRoutersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3188,7 +3188,7 @@ const deserializeAws_restJson1ListVirtualServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3241,7 +3241,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3297,7 +3297,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3351,7 +3351,7 @@ const deserializeAws_restJson1UpdateGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3411,7 +3411,7 @@ const deserializeAws_restJson1UpdateMeshCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3468,7 +3468,7 @@ const deserializeAws_restJson1UpdateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3528,7 +3528,7 @@ const deserializeAws_restJson1UpdateVirtualGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3588,7 +3588,7 @@ const deserializeAws_restJson1UpdateVirtualNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3648,7 +3648,7 @@ const deserializeAws_restJson1UpdateVirtualRouterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3708,7 +3708,7 @@ const deserializeAws_restJson1UpdateVirtualServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7321,6 +7321,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-appconfig/src/protocols/Aws_restJson1.ts b/clients/client-appconfig/src/protocols/Aws_restJson1.ts index 5f7ff6eebf8e..d169eeeebd4b 100644 --- a/clients/client-appconfig/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfig/src/protocols/Aws_restJson1.ts @@ -1675,7 +1675,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_restJson1CreateConfigurationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1808,7 +1808,7 @@ const deserializeAws_restJson1CreateDeploymentStrategyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1867,7 +1867,7 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1932,7 +1932,7 @@ const deserializeAws_restJson1CreateExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1997,7 +1997,7 @@ const deserializeAws_restJson1CreateExtensionAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2053,7 +2053,7 @@ const deserializeAws_restJson1CreateHostedConfigurationVersionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2106,7 +2106,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2150,7 +2150,7 @@ const deserializeAws_restJson1DeleteConfigurationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2197,7 +2197,7 @@ const deserializeAws_restJson1DeleteDeploymentStrategyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2241,7 +2241,7 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2288,7 +2288,7 @@ const deserializeAws_restJson1DeleteExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2332,7 +2332,7 @@ const deserializeAws_restJson1DeleteExtensionAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2376,7 +2376,7 @@ const deserializeAws_restJson1DeleteHostedConfigurationVersionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2476,7 +2476,7 @@ const deserializeAws_restJson1GetConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2544,7 +2544,7 @@ const deserializeAws_restJson1GetConfigurationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2645,7 +2645,7 @@ const deserializeAws_restJson1GetDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2713,7 +2713,7 @@ const deserializeAws_restJson1GetDeploymentStrategyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2775,7 +2775,7 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2840,7 +2840,7 @@ const deserializeAws_restJson1GetExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2902,7 +2902,7 @@ const deserializeAws_restJson1GetExtensionAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2955,7 +2955,7 @@ const deserializeAws_restJson1GetHostedConfigurationVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3005,7 +3005,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3052,7 +3052,7 @@ const deserializeAws_restJson1ListConfigurationProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3102,7 +3102,7 @@ const deserializeAws_restJson1ListDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3152,7 +3152,7 @@ const deserializeAws_restJson1ListDeploymentStrategiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3199,7 +3199,7 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3249,7 +3249,7 @@ const deserializeAws_restJson1ListExtensionAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3296,7 +3296,7 @@ const deserializeAws_restJson1ListExtensionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3343,7 +3343,7 @@ const deserializeAws_restJson1ListHostedConfigurationVersionsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3390,7 +3390,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3491,7 +3491,7 @@ const deserializeAws_restJson1StartDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3595,7 +3595,7 @@ const deserializeAws_restJson1StopDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3639,7 +3639,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3683,7 +3683,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3736,7 +3736,7 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3804,7 +3804,7 @@ const deserializeAws_restJson1UpdateConfigurationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3872,7 +3872,7 @@ const deserializeAws_restJson1UpdateDeploymentStrategyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3934,7 +3934,7 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3999,7 +3999,7 @@ const deserializeAws_restJson1UpdateExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4064,7 +4064,7 @@ const deserializeAws_restJson1UpdateExtensionAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4108,7 +4108,7 @@ const deserializeAws_restJson1ValidateConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4827,6 +4827,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts index 68f865b5a29b..dd086417a8cf 100644 --- a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts @@ -116,7 +116,7 @@ const deserializeAws_restJson1GetLatestConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -166,7 +166,7 @@ const deserializeAws_restJson1StartConfigurationSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -349,6 +349,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-appflow/src/protocols/Aws_restJson1.ts b/clients/client-appflow/src/protocols/Aws_restJson1.ts index 39b538d87c59..1e3d10694508 100644 --- a/clients/client-appflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-appflow/src/protocols/Aws_restJson1.ts @@ -860,7 +860,7 @@ const deserializeAws_restJson1CreateConnectorProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -916,7 +916,7 @@ const deserializeAws_restJson1CreateFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -972,7 +972,7 @@ const deserializeAws_restJson1DeleteConnectorProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1016,7 +1016,7 @@ const deserializeAws_restJson1DeleteFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1066,7 +1066,7 @@ const deserializeAws_restJson1DescribeConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1116,7 +1116,7 @@ const deserializeAws_restJson1DescribeConnectorEntityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1175,7 +1175,7 @@ const deserializeAws_restJson1DescribeConnectorProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1228,7 +1228,7 @@ const deserializeAws_restJson1DescribeConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1320,7 +1320,7 @@ const deserializeAws_restJson1DescribeFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1367,7 +1367,7 @@ const deserializeAws_restJson1DescribeFlowExecutionRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1414,7 +1414,7 @@ const deserializeAws_restJson1ListConnectorEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1470,7 +1470,7 @@ const deserializeAws_restJson1ListConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1517,7 +1517,7 @@ const deserializeAws_restJson1ListFlowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1561,7 +1561,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1608,7 +1608,7 @@ const deserializeAws_restJson1RegisterConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1679,7 +1679,7 @@ const deserializeAws_restJson1StartFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1732,7 +1732,7 @@ const deserializeAws_restJson1StopFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1779,7 +1779,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1823,7 +1823,7 @@ const deserializeAws_restJson1UnregisterConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1867,7 +1867,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1914,7 +1914,7 @@ const deserializeAws_restJson1UpdateConnectorProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1967,7 +1967,7 @@ const deserializeAws_restJson1UpdateFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5498,6 +5498,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts index 8d32bee35add..fe37dc55ae71 100644 --- a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts +++ b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts @@ -523,7 +523,7 @@ const deserializeAws_restJson1CreateDataIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -579,7 +579,7 @@ const deserializeAws_restJson1CreateEventIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -632,7 +632,7 @@ const deserializeAws_restJson1DeleteDataIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -682,7 +682,7 @@ const deserializeAws_restJson1DeleteEventIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -756,7 +756,7 @@ const deserializeAws_restJson1GetDataIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -824,7 +824,7 @@ const deserializeAws_restJson1GetEventIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -883,7 +883,7 @@ const deserializeAws_restJson1ListDataIntegrationAssociationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -939,7 +939,7 @@ const deserializeAws_restJson1ListDataIntegrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -995,7 +995,7 @@ const deserializeAws_restJson1ListEventIntegrationAssociationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1051,7 +1051,7 @@ const deserializeAws_restJson1ListEventIntegrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1101,7 +1101,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1148,7 +1148,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1195,7 +1195,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1242,7 +1242,7 @@ const deserializeAws_restJson1UpdateDataIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1292,7 +1292,7 @@ const deserializeAws_restJson1UpdateEventIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1644,6 +1644,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts index 8c3f8becb678..c8cc1da1c6d4 100644 --- a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts @@ -250,7 +250,7 @@ const deserializeAws_json1_1DeleteScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -300,7 +300,7 @@ const deserializeAws_json1_1DeleteScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -350,7 +350,7 @@ const deserializeAws_json1_1DeregisterScalableTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -400,7 +400,7 @@ const deserializeAws_json1_1DescribeScalableTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -450,7 +450,7 @@ const deserializeAws_json1_1DescribeScalingActivitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -500,7 +500,7 @@ const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -553,7 +553,7 @@ const deserializeAws_json1_1DescribeScheduledActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -603,7 +603,7 @@ const deserializeAws_json1_1PutScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -659,7 +659,7 @@ const deserializeAws_json1_1PutScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -712,7 +712,7 @@ const deserializeAws_json1_1RegisterScalableTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1576,6 +1576,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts index 211ce158b9ca..56af8aa963ef 100644 --- a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts @@ -518,7 +518,7 @@ const deserializeAws_json1_1AssociateConfigurationItemsToApplicationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -571,7 +571,7 @@ const deserializeAws_json1_1BatchDeleteImportDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -624,7 +624,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -677,7 +677,7 @@ const deserializeAws_json1_1CreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -733,7 +733,7 @@ const deserializeAws_json1_1DeleteApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -786,7 +786,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -842,7 +842,7 @@ const deserializeAws_json1_1DescribeAgentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -895,7 +895,7 @@ const deserializeAws_json1_1DescribeConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -948,7 +948,7 @@ const deserializeAws_json1_1DescribeContinuousExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1007,7 +1007,7 @@ const deserializeAws_json1_1DescribeExportConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1063,7 +1063,7 @@ const deserializeAws_json1_1DescribeExportTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1116,7 +1116,7 @@ const deserializeAws_json1_1DescribeImportTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1169,7 +1169,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1225,7 +1225,7 @@ const deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1278,7 +1278,7 @@ const deserializeAws_json1_1ExportConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1334,7 +1334,7 @@ const deserializeAws_json1_1GetDiscoverySummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1387,7 +1387,7 @@ const deserializeAws_json1_1ListConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1443,7 +1443,7 @@ const deserializeAws_json1_1ListServerNeighborsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1496,7 +1496,7 @@ const deserializeAws_json1_1StartContinuousExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1558,7 +1558,7 @@ const deserializeAws_json1_1StartDataCollectionByAgentIdsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1611,7 +1611,7 @@ const deserializeAws_json1_1StartExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1667,7 +1667,7 @@ const deserializeAws_json1_1StartImportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1723,7 +1723,7 @@ const deserializeAws_json1_1StopContinuousExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1785,7 +1785,7 @@ const deserializeAws_json1_1StopDataCollectionByAgentIdsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1838,7 +1838,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3162,6 +3162,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-application-insights/src/protocols/Aws_json1_1.ts b/clients/client-application-insights/src/protocols/Aws_json1_1.ts index bcbd8fe0f48d..5345eb079094 100644 --- a/clients/client-application-insights/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/src/protocols/Aws_json1_1.ts @@ -521,7 +521,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -577,7 +577,7 @@ const deserializeAws_json1_1CreateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -627,7 +627,7 @@ const deserializeAws_json1_1CreateLogPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -677,7 +677,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -727,7 +727,7 @@ const deserializeAws_json1_1DeleteComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -774,7 +774,7 @@ const deserializeAws_json1_1DeleteLogPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -824,7 +824,7 @@ const deserializeAws_json1_1DescribeApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -871,7 +871,7 @@ const deserializeAws_json1_1DescribeComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -918,7 +918,7 @@ const deserializeAws_json1_1DescribeComponentConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -965,7 +965,7 @@ const deserializeAws_json1_1DescribeComponentConfigurationRecommendationCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1012,7 +1012,7 @@ const deserializeAws_json1_1DescribeLogPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_json1_1DescribeObservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1106,7 +1106,7 @@ const deserializeAws_json1_1DescribeProblemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1153,7 +1153,7 @@ const deserializeAws_json1_1DescribeProblemObservationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1244,7 +1244,7 @@ const deserializeAws_json1_1ListComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1291,7 +1291,7 @@ const deserializeAws_json1_1ListConfigurationHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1338,7 +1338,7 @@ const deserializeAws_json1_1ListLogPatternsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1385,7 +1385,7 @@ const deserializeAws_json1_1ListLogPatternSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1432,7 +1432,7 @@ const deserializeAws_json1_1ListProblemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1523,7 +1523,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1570,7 +1570,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1614,7 +1614,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1661,7 +1661,7 @@ const deserializeAws_json1_1UpdateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1711,7 +1711,7 @@ const deserializeAws_json1_1UpdateComponentConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1758,7 +1758,7 @@ const deserializeAws_json1_1UpdateLogPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2851,6 +2851,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts index b092a9f58153..2794c04700f2 100644 --- a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts @@ -231,7 +231,7 @@ const deserializeAws_restJson1DeleteReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -299,7 +299,7 @@ const deserializeAws_restJson1GetReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -349,7 +349,7 @@ const deserializeAws_restJson1ImportApplicationUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -402,7 +402,7 @@ const deserializeAws_restJson1ListReportDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -452,7 +452,7 @@ const deserializeAws_restJson1PutReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -505,7 +505,7 @@ const deserializeAws_restJson1UpdateReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -700,6 +700,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-apprunner/src/protocols/Aws_json1_0.ts b/clients/client-apprunner/src/protocols/Aws_json1_0.ts index ee4de95a8765..11d062831d6d 100644 --- a/clients/client-apprunner/src/protocols/Aws_json1_0.ts +++ b/clients/client-apprunner/src/protocols/Aws_json1_0.ts @@ -596,7 +596,7 @@ const deserializeAws_json1_0AssociateCustomDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -643,7 +643,7 @@ const deserializeAws_json1_0CreateAutoScalingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -690,7 +690,7 @@ const deserializeAws_json1_0CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -737,7 +737,7 @@ const deserializeAws_json1_0CreateObservabilityConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -784,7 +784,7 @@ const deserializeAws_json1_0CreateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -831,7 +831,7 @@ const deserializeAws_json1_0CreateVpcConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -878,7 +878,7 @@ const deserializeAws_json1_0DeleteAutoScalingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_json1_0DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -972,7 +972,7 @@ const deserializeAws_json1_0DeleteObservabilityConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1019,7 +1019,7 @@ const deserializeAws_json1_0DeleteServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1069,7 +1069,7 @@ const deserializeAws_json1_0DeleteVpcConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1116,7 +1116,7 @@ const deserializeAws_json1_0DescribeAutoScalingConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1163,7 +1163,7 @@ const deserializeAws_json1_0DescribeCustomDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1210,7 +1210,7 @@ const deserializeAws_json1_0DescribeObservabilityConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1257,7 +1257,7 @@ const deserializeAws_json1_0DescribeServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1304,7 +1304,7 @@ const deserializeAws_json1_0DescribeVpcConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1351,7 +1351,7 @@ const deserializeAws_json1_0DisassociateCustomDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1401,7 +1401,7 @@ const deserializeAws_json1_0ListAutoScalingConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1445,7 +1445,7 @@ const deserializeAws_json1_0ListConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1489,7 +1489,7 @@ const deserializeAws_json1_0ListObservabilityConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1533,7 +1533,7 @@ const deserializeAws_json1_0ListOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1580,7 +1580,7 @@ const deserializeAws_json1_0ListServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1624,7 +1624,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1674,7 +1674,7 @@ const deserializeAws_json1_0ListVpcConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1718,7 +1718,7 @@ const deserializeAws_json1_0PauseServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1768,7 +1768,7 @@ const deserializeAws_json1_0ResumeServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1818,7 +1818,7 @@ const deserializeAws_json1_0StartDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1865,7 +1865,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1915,7 +1915,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1965,7 +1965,7 @@ const deserializeAws_json1_0UpdateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3483,6 +3483,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-appstream/src/protocols/Aws_json1_1.ts b/clients/client-appstream/src/protocols/Aws_json1_1.ts index a4a38edd37d1..c170102e81f4 100644 --- a/clients/client-appstream/src/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/src/protocols/Aws_json1_1.ts @@ -1218,7 +1218,7 @@ const deserializeAws_json1_1AssociateApplicationFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1271,7 +1271,7 @@ const deserializeAws_json1_1AssociateApplicationToEntitlementCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1321,7 +1321,7 @@ const deserializeAws_json1_1AssociateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1377,7 +1377,7 @@ const deserializeAws_json1_1BatchAssociateUserStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1421,7 +1421,7 @@ const deserializeAws_json1_1BatchDisassociateUserStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1465,7 +1465,7 @@ const deserializeAws_json1_1CopyImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1521,7 +1521,7 @@ const deserializeAws_json1_1CreateAppBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1571,7 +1571,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1624,7 +1624,7 @@ const deserializeAws_json1_1CreateDirectoryConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1680,7 +1680,7 @@ const deserializeAws_json1_1CreateEntitlementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1730,7 +1730,7 @@ const deserializeAws_json1_1CreateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1801,7 +1801,7 @@ const deserializeAws_json1_1CreateImageBuilderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1872,7 +1872,7 @@ const deserializeAws_json1_1CreateImageBuilderStreamingURLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1916,7 +1916,7 @@ const deserializeAws_json1_1CreateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1975,7 +1975,7 @@ const deserializeAws_json1_1CreateStreamingURLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2025,7 +2025,7 @@ const deserializeAws_json1_1CreateUpdatedImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2084,7 +2084,7 @@ const deserializeAws_json1_1CreateUsageReportSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2131,7 +2131,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2184,7 +2184,7 @@ const deserializeAws_json1_1DeleteAppBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2231,7 +2231,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2281,7 +2281,7 @@ const deserializeAws_json1_1DeleteDirectoryConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2325,7 +2325,7 @@ const deserializeAws_json1_1DeleteEntitlementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2375,7 +2375,7 @@ const deserializeAws_json1_1DeleteFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2422,7 +2422,7 @@ const deserializeAws_json1_1DeleteImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2472,7 +2472,7 @@ const deserializeAws_json1_1DeleteImageBuilderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2519,7 +2519,7 @@ const deserializeAws_json1_1DeleteImagePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2563,7 +2563,7 @@ const deserializeAws_json1_1DeleteStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2613,7 +2613,7 @@ const deserializeAws_json1_1DeleteUsageReportSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2657,7 +2657,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2698,7 +2698,7 @@ const deserializeAws_json1_1DescribeAppBlocksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2742,7 +2742,7 @@ const deserializeAws_json1_1DescribeApplicationFleetAssociationsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2786,7 +2786,7 @@ const deserializeAws_json1_1DescribeApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2830,7 +2830,7 @@ const deserializeAws_json1_1DescribeDirectoryConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2871,7 +2871,7 @@ const deserializeAws_json1_1DescribeEntitlementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2918,7 +2918,7 @@ const deserializeAws_json1_1DescribeFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2959,7 +2959,7 @@ const deserializeAws_json1_1DescribeImageBuildersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3000,7 +3000,7 @@ const deserializeAws_json1_1DescribeImagePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3041,7 +3041,7 @@ const deserializeAws_json1_1DescribeImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3085,7 +3085,7 @@ const deserializeAws_json1_1DescribeSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3126,7 +3126,7 @@ const deserializeAws_json1_1DescribeStacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3167,7 +3167,7 @@ const deserializeAws_json1_1DescribeUsageReportSubscriptionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3211,7 +3211,7 @@ const deserializeAws_json1_1DescribeUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3258,7 +3258,7 @@ const deserializeAws_json1_1DescribeUserStackAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3302,7 +3302,7 @@ const deserializeAws_json1_1DisableUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3343,7 +3343,7 @@ const deserializeAws_json1_1DisassociateApplicationFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3390,7 +3390,7 @@ const deserializeAws_json1_1DisassociateApplicationFromEntitlementCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3437,7 +3437,7 @@ const deserializeAws_json1_1DisassociateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3487,7 +3487,7 @@ const deserializeAws_json1_1EnableUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3531,7 +3531,7 @@ const deserializeAws_json1_1ExpireSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3566,7 +3566,7 @@ const deserializeAws_json1_1ListAssociatedFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3601,7 +3601,7 @@ const deserializeAws_json1_1ListAssociatedStacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3636,7 +3636,7 @@ const deserializeAws_json1_1ListEntitledApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3683,7 +3683,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3724,7 +3724,7 @@ const deserializeAws_json1_1StartFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,7 +3786,7 @@ const deserializeAws_json1_1StartImageBuilderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3839,7 +3839,7 @@ const deserializeAws_json1_1StopFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3883,7 +3883,7 @@ const deserializeAws_json1_1StopImageBuilderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3930,7 +3930,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3977,7 +3977,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4018,7 +4018,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4065,7 +4065,7 @@ const deserializeAws_json1_1UpdateDirectoryConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4118,7 +4118,7 @@ const deserializeAws_json1_1UpdateEntitlementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4168,7 +4168,7 @@ const deserializeAws_json1_1UpdateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4239,7 +4239,7 @@ const deserializeAws_json1_1UpdateImagePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4286,7 +4286,7 @@ const deserializeAws_json1_1UpdateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7247,6 +7247,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-appsync/src/protocols/Aws_restJson1.ts b/clients/client-appsync/src/protocols/Aws_restJson1.ts index 4c0fe60fc232..f2f0ae20d845 100644 --- a/clients/client-appsync/src/protocols/Aws_restJson1.ts +++ b/clients/client-appsync/src/protocols/Aws_restJson1.ts @@ -1508,7 +1508,7 @@ const deserializeAws_restJson1AssociateApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1558,7 +1558,7 @@ const deserializeAws_restJson1CreateApiCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1611,7 +1611,7 @@ const deserializeAws_restJson1CreateApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1670,7 +1670,7 @@ const deserializeAws_restJson1CreateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1723,7 +1723,7 @@ const deserializeAws_restJson1CreateDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1770,7 +1770,7 @@ const deserializeAws_restJson1CreateFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1820,7 +1820,7 @@ const deserializeAws_restJson1CreateGraphqlApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1876,7 +1876,7 @@ const deserializeAws_restJson1CreateResolverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1926,7 +1926,7 @@ const deserializeAws_restJson1CreateTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1976,7 +1976,7 @@ const deserializeAws_restJson1DeleteApiCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2026,7 +2026,7 @@ const deserializeAws_restJson1DeleteApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2073,7 +2073,7 @@ const deserializeAws_restJson1DeleteDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2123,7 +2123,7 @@ const deserializeAws_restJson1DeleteDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2173,7 +2173,7 @@ const deserializeAws_restJson1DeleteFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2220,7 +2220,7 @@ const deserializeAws_restJson1DeleteGraphqlApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2273,7 +2273,7 @@ const deserializeAws_restJson1DeleteResolverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2320,7 +2320,7 @@ const deserializeAws_restJson1DeleteTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2370,7 +2370,7 @@ const deserializeAws_restJson1DisassociateApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2426,7 +2426,7 @@ const deserializeAws_restJson1EvaluateMappingTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2470,7 +2470,7 @@ const deserializeAws_restJson1FlushApiCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2523,7 +2523,7 @@ const deserializeAws_restJson1GetApiAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2573,7 +2573,7 @@ const deserializeAws_restJson1GetApiCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2626,7 +2626,7 @@ const deserializeAws_restJson1GetDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2679,7 +2679,7 @@ const deserializeAws_restJson1GetDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2729,7 +2729,7 @@ const deserializeAws_restJson1GetFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2776,7 +2776,7 @@ const deserializeAws_restJson1GetGraphqlApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2827,7 +2827,7 @@ const deserializeAws_restJson1GetIntrospectionSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2877,7 +2877,7 @@ const deserializeAws_restJson1GetResolverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2927,7 +2927,7 @@ const deserializeAws_restJson1GetSchemaCreationStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2977,7 +2977,7 @@ const deserializeAws_restJson1GetTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3033,7 +3033,7 @@ const deserializeAws_restJson1ListApiKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3086,7 +3086,7 @@ const deserializeAws_restJson1ListDataSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3139,7 +3139,7 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3189,7 +3189,7 @@ const deserializeAws_restJson1ListFunctionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3242,7 +3242,7 @@ const deserializeAws_restJson1ListGraphqlApisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3292,7 +3292,7 @@ const deserializeAws_restJson1ListResolversCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3345,7 +3345,7 @@ const deserializeAws_restJson1ListResolversByFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3395,7 +3395,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3454,7 +3454,7 @@ const deserializeAws_restJson1ListTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3507,7 +3507,7 @@ const deserializeAws_restJson1StartSchemaCreationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3557,7 +3557,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3610,7 +3610,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3666,7 +3666,7 @@ const deserializeAws_restJson1UpdateApiCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3719,7 +3719,7 @@ const deserializeAws_restJson1UpdateApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3775,7 +3775,7 @@ const deserializeAws_restJson1UpdateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3828,7 +3828,7 @@ const deserializeAws_restJson1UpdateDomainNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3881,7 +3881,7 @@ const deserializeAws_restJson1UpdateFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3931,7 +3931,7 @@ const deserializeAws_restJson1UpdateGraphqlApiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3987,7 +3987,7 @@ const deserializeAws_restJson1UpdateResolverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4037,7 +4037,7 @@ const deserializeAws_restJson1UpdateTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5014,6 +5014,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-athena/src/protocols/Aws_json1_1.ts b/clients/client-athena/src/protocols/Aws_json1_1.ts index c5cb742d65c9..096ddaff24c9 100644 --- a/clients/client-athena/src/protocols/Aws_json1_1.ts +++ b/clients/client-athena/src/protocols/Aws_json1_1.ts @@ -712,7 +712,7 @@ const deserializeAws_json1_1BatchGetNamedQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -756,7 +756,7 @@ const deserializeAws_json1_1BatchGetPreparedStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -800,7 +800,7 @@ const deserializeAws_json1_1BatchGetQueryExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -844,7 +844,7 @@ const deserializeAws_json1_1CreateDataCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -888,7 +888,7 @@ const deserializeAws_json1_1CreateNamedQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -932,7 +932,7 @@ const deserializeAws_json1_1CreatePreparedStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -976,7 +976,7 @@ const deserializeAws_json1_1CreateWorkGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1020,7 +1020,7 @@ const deserializeAws_json1_1DeleteDataCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1064,7 +1064,7 @@ const deserializeAws_json1_1DeleteNamedQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1108,7 +1108,7 @@ const deserializeAws_json1_1DeletePreparedStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1155,7 +1155,7 @@ const deserializeAws_json1_1DeleteWorkGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1199,7 +1199,7 @@ const deserializeAws_json1_1GetDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1246,7 +1246,7 @@ const deserializeAws_json1_1GetDataCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1290,7 +1290,7 @@ const deserializeAws_json1_1GetNamedQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1334,7 +1334,7 @@ const deserializeAws_json1_1GetPreparedStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1381,7 +1381,7 @@ const deserializeAws_json1_1GetQueryExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1425,7 +1425,7 @@ const deserializeAws_json1_1GetQueryResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1469,7 +1469,7 @@ const deserializeAws_json1_1GetQueryRuntimeStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1513,7 +1513,7 @@ const deserializeAws_json1_1GetTableMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1560,7 +1560,7 @@ const deserializeAws_json1_1GetWorkGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1604,7 +1604,7 @@ const deserializeAws_json1_1ListDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1651,7 +1651,7 @@ const deserializeAws_json1_1ListDataCatalogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1695,7 +1695,7 @@ const deserializeAws_json1_1ListEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1739,7 +1739,7 @@ const deserializeAws_json1_1ListNamedQueriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1783,7 +1783,7 @@ const deserializeAws_json1_1ListPreparedStatementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1827,7 +1827,7 @@ const deserializeAws_json1_1ListQueryExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1871,7 +1871,7 @@ const deserializeAws_json1_1ListTableMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1918,7 +1918,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1965,7 +1965,7 @@ const deserializeAws_json1_1ListWorkGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2009,7 +2009,7 @@ const deserializeAws_json1_1StartQueryExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2056,7 +2056,7 @@ const deserializeAws_json1_1StopQueryExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2100,7 +2100,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2147,7 +2147,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2194,7 +2194,7 @@ const deserializeAws_json1_1UpdateDataCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2238,7 +2238,7 @@ const deserializeAws_json1_1UpdateNamedQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2282,7 +2282,7 @@ const deserializeAws_json1_1UpdatePreparedStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2329,7 +2329,7 @@ const deserializeAws_json1_1UpdateWorkGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4022,6 +4022,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts index e578e4bbda06..dc2f136ee2c6 100644 --- a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts @@ -2095,7 +2095,7 @@ const deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2148,7 +2148,7 @@ const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2201,7 +2201,7 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2251,7 +2251,7 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2304,7 +2304,7 @@ const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2354,7 +2354,7 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2404,7 +2404,7 @@ const deserializeAws_restJson1CreateAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2457,7 +2457,7 @@ const deserializeAws_restJson1CreateAssessmentFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2510,7 +2510,7 @@ const deserializeAws_restJson1CreateAssessmentReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2560,7 +2560,7 @@ const deserializeAws_restJson1CreateControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2610,7 +2610,7 @@ const deserializeAws_restJson1DeleteAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2657,7 +2657,7 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2704,7 +2704,7 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2751,7 +2751,7 @@ const deserializeAws_restJson1DeleteAssessmentReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2798,7 +2798,7 @@ const deserializeAws_restJson1DeleteControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2848,7 +2848,7 @@ const deserializeAws_restJson1DeregisterAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2895,7 +2895,7 @@ const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2942,7 +2942,7 @@ const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2992,7 +2992,7 @@ const deserializeAws_restJson1GetAccountStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3036,7 +3036,7 @@ const deserializeAws_restJson1GetAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3086,7 +3086,7 @@ const deserializeAws_restJson1GetAssessmentFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3136,7 +3136,7 @@ const deserializeAws_restJson1GetAssessmentReportUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3189,7 +3189,7 @@ const deserializeAws_restJson1GetChangeLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3239,7 +3239,7 @@ const deserializeAws_restJson1GetControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3292,7 +3292,7 @@ const deserializeAws_restJson1GetDelegationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3339,7 +3339,7 @@ const deserializeAws_restJson1GetEvidenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3392,7 +3392,7 @@ const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3442,7 +3442,7 @@ const deserializeAws_restJson1GetEvidenceFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3495,7 +3495,7 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3548,7 +3548,7 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3598,7 +3598,7 @@ const deserializeAws_restJson1GetInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3642,7 +3642,7 @@ const deserializeAws_restJson1GetInsightsByAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3695,7 +3695,7 @@ const deserializeAws_restJson1GetOrganizationAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3745,7 +3745,7 @@ const deserializeAws_restJson1GetServicesInScopeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3792,7 +3792,7 @@ const deserializeAws_restJson1GetSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3842,7 +3842,7 @@ const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3895,7 +3895,7 @@ const deserializeAws_restJson1ListAssessmentFrameworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3948,7 +3948,7 @@ const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3998,7 +3998,7 @@ const deserializeAws_restJson1ListAssessmentReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4048,7 +4048,7 @@ const deserializeAws_restJson1ListAssessmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4101,7 +4101,7 @@ const deserializeAws_restJson1ListControlDomainInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4157,7 +4157,7 @@ const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4213,7 +4213,7 @@ const deserializeAws_restJson1ListControlInsightsByControlDomainCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4266,7 +4266,7 @@ const deserializeAws_restJson1ListControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4316,7 +4316,7 @@ const deserializeAws_restJson1ListKeywordsForDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4366,7 +4366,7 @@ const deserializeAws_restJson1ListNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4413,7 +4413,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4460,7 +4460,7 @@ const deserializeAws_restJson1RegisterAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4516,7 +4516,7 @@ const deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4569,7 +4569,7 @@ const deserializeAws_restJson1StartAssessmentFrameworkShareCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4616,7 +4616,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4660,7 +4660,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4707,7 +4707,7 @@ const deserializeAws_restJson1UpdateAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4757,7 +4757,7 @@ const deserializeAws_restJson1UpdateAssessmentControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4807,7 +4807,7 @@ const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4857,7 +4857,7 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4910,7 +4910,7 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4960,7 +4960,7 @@ const deserializeAws_restJson1UpdateAssessmentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5013,7 +5013,7 @@ const deserializeAws_restJson1UpdateControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5063,7 +5063,7 @@ const deserializeAws_restJson1UpdateSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5122,7 +5122,7 @@ const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6690,6 +6690,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts index c9c122855c3f..18e5bfd13f9a 100644 --- a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts @@ -171,7 +171,7 @@ const deserializeAws_json1_1CreateScalingPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -221,7 +221,7 @@ const deserializeAws_json1_1DeleteScalingPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -271,7 +271,7 @@ const deserializeAws_json1_1DescribeScalingPlanResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -321,7 +321,7 @@ const deserializeAws_json1_1DescribeScalingPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -371,7 +371,7 @@ const deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -415,7 +415,7 @@ const deserializeAws_json1_1UpdateScalingPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1250,6 +1250,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-auto-scaling/src/protocols/Aws_query.ts b/clients/client-auto-scaling/src/protocols/Aws_query.ts index 53f22303196a..e726821ca6dd 100644 --- a/clients/client-auto-scaling/src/protocols/Aws_query.ts +++ b/clients/client-auto-scaling/src/protocols/Aws_query.ts @@ -1373,7 +1373,7 @@ const deserializeAws_queryAttachInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1417,7 +1417,7 @@ const deserializeAws_queryAttachLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1464,7 +1464,7 @@ const deserializeAws_queryAttachLoadBalancerTargetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1508,7 +1508,7 @@ const deserializeAws_queryBatchDeleteScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1552,7 +1552,7 @@ const deserializeAws_queryBatchPutScheduledUpdateGroupActionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1599,7 +1599,7 @@ const deserializeAws_queryCancelInstanceRefreshCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1646,7 +1646,7 @@ const deserializeAws_queryCompleteLifecycleActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1684,7 +1684,7 @@ const deserializeAws_queryCreateAutoScalingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1731,7 +1731,7 @@ const deserializeAws_queryCreateLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1775,7 +1775,7 @@ const deserializeAws_queryCreateOrUpdateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1822,7 +1822,7 @@ const deserializeAws_queryDeleteAutoScalingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1866,7 +1866,7 @@ const deserializeAws_queryDeleteLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1910,7 +1910,7 @@ const deserializeAws_queryDeleteLifecycleHookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1948,7 +1948,7 @@ const deserializeAws_queryDeleteNotificationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1986,7 +1986,7 @@ const deserializeAws_queryDeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2027,7 +2027,7 @@ const deserializeAws_queryDeleteScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2065,7 +2065,7 @@ const deserializeAws_queryDeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2109,7 +2109,7 @@ const deserializeAws_queryDeleteWarmPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2159,7 +2159,7 @@ const deserializeAws_queryDescribeAccountLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2200,7 +2200,7 @@ const deserializeAws_queryDescribeAdjustmentTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2241,7 +2241,7 @@ const deserializeAws_queryDescribeAutoScalingGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2285,7 +2285,7 @@ const deserializeAws_queryDescribeAutoScalingInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2332,7 +2332,7 @@ const deserializeAws_queryDescribeAutoScalingNotificationTypesCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2373,7 +2373,7 @@ const deserializeAws_queryDescribeInstanceRefreshesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2417,7 +2417,7 @@ const deserializeAws_queryDescribeLaunchConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2461,7 +2461,7 @@ const deserializeAws_queryDescribeLifecycleHooksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2502,7 +2502,7 @@ const deserializeAws_queryDescribeLifecycleHookTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2543,7 +2543,7 @@ const deserializeAws_queryDescribeLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2590,7 +2590,7 @@ const deserializeAws_queryDescribeLoadBalancerTargetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2634,7 +2634,7 @@ const deserializeAws_queryDescribeMetricCollectionTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2678,7 +2678,7 @@ const deserializeAws_queryDescribeNotificationConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2722,7 +2722,7 @@ const deserializeAws_queryDescribePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2769,7 +2769,7 @@ const deserializeAws_queryDescribeScalingActivitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2813,7 +2813,7 @@ const deserializeAws_queryDescribeScalingProcessTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2854,7 +2854,7 @@ const deserializeAws_queryDescribeScheduledActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2898,7 +2898,7 @@ const deserializeAws_queryDescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2945,7 +2945,7 @@ const deserializeAws_queryDescribeTerminationPolicyTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2986,7 +2986,7 @@ const deserializeAws_queryDescribeWarmPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3033,7 +3033,7 @@ const deserializeAws_queryDetachInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3074,7 +3074,7 @@ const deserializeAws_queryDetachLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3118,7 +3118,7 @@ const deserializeAws_queryDetachLoadBalancerTargetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_queryDisableMetricsCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3194,7 +3194,7 @@ const deserializeAws_queryEnableMetricsCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3235,7 +3235,7 @@ const deserializeAws_queryEnterStandbyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3273,7 +3273,7 @@ const deserializeAws_queryExecutePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3317,7 +3317,7 @@ const deserializeAws_queryExitStandbyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3358,7 +3358,7 @@ const deserializeAws_queryGetPredictiveScalingForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3399,7 +3399,7 @@ const deserializeAws_queryPutLifecycleHookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3440,7 +3440,7 @@ const deserializeAws_queryPutNotificationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3487,7 +3487,7 @@ const deserializeAws_queryPutScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3531,7 +3531,7 @@ const deserializeAws_queryPutScheduledUpdateGroupActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3578,7 +3578,7 @@ const deserializeAws_queryPutWarmPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3625,7 +3625,7 @@ const deserializeAws_queryRecordLifecycleActionHeartbeatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3663,7 +3663,7 @@ const deserializeAws_queryResumeProcessesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3704,7 +3704,7 @@ const deserializeAws_querySetDesiredCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3745,7 +3745,7 @@ const deserializeAws_querySetInstanceHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,7 +3786,7 @@ const deserializeAws_querySetInstanceProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3830,7 +3830,7 @@ const deserializeAws_queryStartInstanceRefreshCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3874,7 +3874,7 @@ const deserializeAws_querySuspendProcessesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3918,7 +3918,7 @@ const deserializeAws_queryTerminateInstanceInAutoScalingGroupCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3959,7 +3959,7 @@ const deserializeAws_queryUpdateAutoScalingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9856,6 +9856,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts index 67d2c012f07a..5674f4c08f84 100644 --- a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts +++ b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts @@ -387,7 +387,7 @@ const deserializeAws_json1_0AssociateGatewayToServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -437,7 +437,7 @@ const deserializeAws_json1_0CreateGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -484,7 +484,7 @@ const deserializeAws_json1_0DeleteGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -534,7 +534,7 @@ const deserializeAws_json1_0DeleteHypervisorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -587,7 +587,7 @@ const deserializeAws_json1_0DisassociateGatewayFromServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -640,7 +640,7 @@ const deserializeAws_json1_0GetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -690,7 +690,7 @@ const deserializeAws_json1_0GetVirtualMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -740,7 +740,7 @@ const deserializeAws_json1_0ImportHypervisorConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -790,7 +790,7 @@ const deserializeAws_json1_0ListGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -837,7 +837,7 @@ const deserializeAws_json1_0ListHypervisorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -884,7 +884,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_json1_0ListVirtualMachinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -981,7 +981,7 @@ const deserializeAws_json1_0PutMaintenanceStartTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1034,7 +1034,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1084,7 +1084,7 @@ const deserializeAws_json1_0TestHypervisorConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1187,7 +1187,7 @@ const deserializeAws_json1_0UpdateGatewayInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1240,7 +1240,7 @@ const deserializeAws_json1_0UpdateGatewaySoftwareNowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1290,7 +1290,7 @@ const deserializeAws_json1_0UpdateHypervisorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1979,6 +1979,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-backup/src/protocols/Aws_restJson1.ts b/clients/client-backup/src/protocols/Aws_restJson1.ts index e93506245615..9a80a304a2bf 100644 --- a/clients/client-backup/src/protocols/Aws_restJson1.ts +++ b/clients/client-backup/src/protocols/Aws_restJson1.ts @@ -2262,7 +2262,7 @@ const deserializeAws_restJson1CreateBackupPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2321,7 +2321,7 @@ const deserializeAws_restJson1CreateBackupSelectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2380,7 +2380,7 @@ const deserializeAws_restJson1CreateBackupVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2436,7 +2436,7 @@ const deserializeAws_restJson1CreateFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2495,7 +2495,7 @@ const deserializeAws_restJson1CreateReportPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2557,7 +2557,7 @@ const deserializeAws_restJson1DeleteBackupPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2607,7 +2607,7 @@ const deserializeAws_restJson1DeleteBackupSelectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2654,7 +2654,7 @@ const deserializeAws_restJson1DeleteBackupVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2704,7 +2704,7 @@ const deserializeAws_restJson1DeleteBackupVaultAccessPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2751,7 +2751,7 @@ const deserializeAws_restJson1DeleteBackupVaultLockConfigurationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2801,7 +2801,7 @@ const deserializeAws_restJson1DeleteBackupVaultNotificationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2848,7 +2848,7 @@ const deserializeAws_restJson1DeleteFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2898,7 +2898,7 @@ const deserializeAws_restJson1DeleteRecoveryPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2951,7 +2951,7 @@ const deserializeAws_restJson1DeleteReportPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3063,7 +3063,7 @@ const deserializeAws_restJson1DescribeBackupJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3143,7 +3143,7 @@ const deserializeAws_restJson1DescribeBackupVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3193,7 +3193,7 @@ const deserializeAws_restJson1DescribeCopyJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3264,7 +3264,7 @@ const deserializeAws_restJson1DescribeFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3317,7 +3317,7 @@ const deserializeAws_restJson1DescribeGlobalSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3367,7 +3367,7 @@ const deserializeAws_restJson1DescribeProtectedResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3471,7 +3471,7 @@ const deserializeAws_restJson1DescribeRecoveryPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3530,7 +3530,7 @@ const deserializeAws_restJson1DescribeRegionSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3571,7 +3571,7 @@ const deserializeAws_restJson1DescribeReportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3618,7 +3618,7 @@ const deserializeAws_restJson1DescribeReportPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3704,7 +3704,7 @@ const deserializeAws_restJson1DescribeRestoreJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3754,7 +3754,7 @@ const deserializeAws_restJson1DisassociateRecoveryPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3810,7 +3810,7 @@ const deserializeAws_restJson1ExportBackupPlanTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3887,7 +3887,7 @@ const deserializeAws_restJson1GetBackupPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3937,7 +3937,7 @@ const deserializeAws_restJson1GetBackupPlanFromJSONCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3990,7 +3990,7 @@ const deserializeAws_restJson1GetBackupPlanFromTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4052,7 +4052,7 @@ const deserializeAws_restJson1GetBackupSelectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4108,7 +4108,7 @@ const deserializeAws_restJson1GetBackupVaultAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4167,7 +4167,7 @@ const deserializeAws_restJson1GetBackupVaultNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4223,7 +4223,7 @@ const deserializeAws_restJson1GetRecoveryPointRestoreMetadataCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4273,7 +4273,7 @@ const deserializeAws_restJson1GetSupportedResourceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4317,7 +4317,7 @@ const deserializeAws_restJson1ListBackupJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4364,7 +4364,7 @@ const deserializeAws_restJson1ListBackupPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4420,7 +4420,7 @@ const deserializeAws_restJson1ListBackupPlanTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4476,7 +4476,7 @@ const deserializeAws_restJson1ListBackupPlanVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4529,7 +4529,7 @@ const deserializeAws_restJson1ListBackupSelectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4582,7 +4582,7 @@ const deserializeAws_restJson1ListBackupVaultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4635,7 +4635,7 @@ const deserializeAws_restJson1ListCopyJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4682,7 +4682,7 @@ const deserializeAws_restJson1ListFrameworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4729,7 +4729,7 @@ const deserializeAws_restJson1ListProtectedResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4776,7 +4776,7 @@ const deserializeAws_restJson1ListRecoveryPointsByBackupVaultCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4829,7 +4829,7 @@ const deserializeAws_restJson1ListRecoveryPointsByResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4882,7 +4882,7 @@ const deserializeAws_restJson1ListReportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4929,7 +4929,7 @@ const deserializeAws_restJson1ListReportPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4976,7 +4976,7 @@ const deserializeAws_restJson1ListRestoreJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5029,7 +5029,7 @@ const deserializeAws_restJson1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5076,7 +5076,7 @@ const deserializeAws_restJson1PutBackupVaultAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5123,7 +5123,7 @@ const deserializeAws_restJson1PutBackupVaultLockConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5173,7 +5173,7 @@ const deserializeAws_restJson1PutBackupVaultNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5229,7 +5229,7 @@ const deserializeAws_restJson1StartBackupJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5288,7 +5288,7 @@ const deserializeAws_restJson1StartCopyJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5344,7 +5344,7 @@ const deserializeAws_restJson1StartReportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5394,7 +5394,7 @@ const deserializeAws_restJson1StartRestoreJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5441,7 +5441,7 @@ const deserializeAws_restJson1StopBackupJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5491,7 +5491,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5541,7 +5541,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5606,7 +5606,7 @@ const deserializeAws_restJson1UpdateBackupPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5662,7 +5662,7 @@ const deserializeAws_restJson1UpdateFrameworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5718,7 +5718,7 @@ const deserializeAws_restJson1UpdateGlobalSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5777,7 +5777,7 @@ const deserializeAws_restJson1UpdateRecoveryPointLifecycleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5827,7 +5827,7 @@ const deserializeAws_restJson1UpdateRegionSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5880,7 +5880,7 @@ const deserializeAws_restJson1UpdateReportPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7463,6 +7463,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts index 60770c3ef55b..9c8ba060c42c 100644 --- a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts +++ b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts @@ -375,7 +375,7 @@ const deserializeAws_restJson1DeleteObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -438,7 +438,7 @@ const deserializeAws_restJson1GetChunkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -502,7 +502,7 @@ const deserializeAws_restJson1GetObjectMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -567,7 +567,7 @@ const deserializeAws_restJson1ListChunksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -626,7 +626,7 @@ const deserializeAws_restJson1ListObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -691,7 +691,7 @@ const deserializeAws_restJson1NotifyObjectCompleteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -756,7 +756,7 @@ const deserializeAws_restJson1PutChunkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -827,7 +827,7 @@ const deserializeAws_restJson1PutObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -889,7 +889,7 @@ const deserializeAws_restJson1StartObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1174,6 +1174,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-batch/src/protocols/Aws_restJson1.ts b/clients/client-batch/src/protocols/Aws_restJson1.ts index 25a3ed7f55d9..b7a99213a613 100644 --- a/clients/client-batch/src/protocols/Aws_restJson1.ts +++ b/clients/client-batch/src/protocols/Aws_restJson1.ts @@ -845,7 +845,7 @@ const deserializeAws_restJson1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -892,7 +892,7 @@ const deserializeAws_restJson1CreateComputeEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -939,7 +939,7 @@ const deserializeAws_restJson1CreateJobQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -986,7 +986,7 @@ const deserializeAws_restJson1CreateSchedulingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1027,7 +1027,7 @@ const deserializeAws_restJson1DeleteComputeEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1068,7 +1068,7 @@ const deserializeAws_restJson1DeleteJobQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1109,7 +1109,7 @@ const deserializeAws_restJson1DeleteSchedulingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1150,7 +1150,7 @@ const deserializeAws_restJson1DeregisterJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_restJson1DescribeComputeEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1247,7 +1247,7 @@ const deserializeAws_restJson1DescribeJobDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1294,7 +1294,7 @@ const deserializeAws_restJson1DescribeJobQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1338,7 +1338,7 @@ const deserializeAws_restJson1DescribeJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1382,7 +1382,7 @@ const deserializeAws_restJson1DescribeSchedulingPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1429,7 +1429,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_restJson1ListSchedulingPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1523,7 +1523,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1573,7 +1573,7 @@ const deserializeAws_restJson1RegisterJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1623,7 +1623,7 @@ const deserializeAws_restJson1SubmitJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1664,7 +1664,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_restJson1TerminateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1746,7 +1746,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_restJson1UpdateComputeEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1UpdateJobQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1881,7 +1881,7 @@ const deserializeAws_restJson1UpdateSchedulingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3558,6 +3558,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts index 96e5b91e7887..1be4471a0af0 100644 --- a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts +++ b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts @@ -1004,7 +1004,7 @@ const deserializeAws_restJson1AssociateAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1063,7 +1063,7 @@ const deserializeAws_restJson1AssociatePricingRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1131,7 +1131,7 @@ const deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1199,7 +1199,7 @@ const deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1255,7 +1255,7 @@ const deserializeAws_restJson1CreateBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1311,7 +1311,7 @@ const deserializeAws_restJson1CreateCustomLineItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1367,7 +1367,7 @@ const deserializeAws_restJson1CreatePricingPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1426,7 +1426,7 @@ const deserializeAws_restJson1CreatePricingRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1482,7 +1482,7 @@ const deserializeAws_restJson1DeleteBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1532,7 +1532,7 @@ const deserializeAws_restJson1DeleteCustomLineItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1585,7 +1585,7 @@ const deserializeAws_restJson1DeletePricingPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1638,7 +1638,7 @@ const deserializeAws_restJson1DeletePricingRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1691,7 +1691,7 @@ const deserializeAws_restJson1DisassociateAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1747,7 +1747,7 @@ const deserializeAws_restJson1DisassociatePricingRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1806,7 +1806,7 @@ const deserializeAws_restJson1ListAccountAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1865,7 +1865,7 @@ const deserializeAws_restJson1ListBillingGroupCostReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1921,7 +1921,7 @@ const deserializeAws_restJson1ListBillingGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1977,7 +1977,7 @@ const deserializeAws_restJson1ListCustomLineItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2036,7 +2036,7 @@ const deserializeAws_restJson1ListPricingPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2095,7 +2095,7 @@ const deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2154,7 +2154,7 @@ const deserializeAws_restJson1ListPricingRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2213,7 +2213,7 @@ const deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2328,7 +2328,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2378,7 +2378,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2428,7 +2428,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2505,7 +2505,7 @@ const deserializeAws_restJson1UpdateBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2579,7 +2579,7 @@ const deserializeAws_restJson1UpdateCustomLineItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2644,7 +2644,7 @@ const deserializeAws_restJson1UpdatePricingPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2724,7 +2724,7 @@ const deserializeAws_restJson1UpdatePricingRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3572,6 +3572,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-braket/src/protocols/Aws_restJson1.ts b/clients/client-braket/src/protocols/Aws_restJson1.ts index 06a5a387bc83..a7cf61bfadd0 100644 --- a/clients/client-braket/src/protocols/Aws_restJson1.ts +++ b/clients/client-braket/src/protocols/Aws_restJson1.ts @@ -447,7 +447,7 @@ const deserializeAws_restJson1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -506,7 +506,7 @@ const deserializeAws_restJson1CancelQuantumTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -562,7 +562,7 @@ const deserializeAws_restJson1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -621,7 +621,7 @@ const deserializeAws_restJson1CreateQuantumTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -695,7 +695,7 @@ const deserializeAws_restJson1GetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -805,7 +805,7 @@ const deserializeAws_restJson1GetJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -891,7 +891,7 @@ const deserializeAws_restJson1GetQuantumTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -944,7 +944,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -994,7 +994,7 @@ const deserializeAws_restJson1SearchDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1047,7 +1047,7 @@ const deserializeAws_restJson1SearchJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1100,7 +1100,7 @@ const deserializeAws_restJson1SearchQuantumTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1147,7 +1147,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1191,7 +1191,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1782,6 +1782,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-budgets/src/protocols/Aws_json1_1.ts b/clients/client-budgets/src/protocols/Aws_json1_1.ts index cb2a9f538de2..f158cf155227 100644 --- a/clients/client-budgets/src/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/src/protocols/Aws_json1_1.ts @@ -472,7 +472,7 @@ const deserializeAws_json1_1CreateBudgetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -528,7 +528,7 @@ const deserializeAws_json1_1CreateBudgetActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -587,7 +587,7 @@ const deserializeAws_json1_1CreateNotificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -646,7 +646,7 @@ const deserializeAws_json1_1CreateSubscriberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -705,7 +705,7 @@ const deserializeAws_json1_1DeleteBudgetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -758,7 +758,7 @@ const deserializeAws_json1_1DeleteBudgetActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -814,7 +814,7 @@ const deserializeAws_json1_1DeleteNotificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -867,7 +867,7 @@ const deserializeAws_json1_1DeleteSubscriberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -920,7 +920,7 @@ const deserializeAws_json1_1DescribeBudgetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -973,7 +973,7 @@ const deserializeAws_json1_1DescribeBudgetActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1026,7 +1026,7 @@ const deserializeAws_json1_1DescribeBudgetActionHistoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1082,7 +1082,7 @@ const deserializeAws_json1_1DescribeBudgetActionsForAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1135,7 +1135,7 @@ const deserializeAws_json1_1DescribeBudgetActionsForBudgetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1191,7 +1191,7 @@ const deserializeAws_json1_1DescribeBudgetNotificationsForAccountCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1250,7 +1250,7 @@ const deserializeAws_json1_1DescribeBudgetPerformanceHistoryCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1309,7 +1309,7 @@ const deserializeAws_json1_1DescribeBudgetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1368,7 +1368,7 @@ const deserializeAws_json1_1DescribeNotificationsForBudgetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1427,7 +1427,7 @@ const deserializeAws_json1_1DescribeSubscribersForNotificationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1486,7 +1486,7 @@ const deserializeAws_json1_1ExecuteBudgetActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1542,7 +1542,7 @@ const deserializeAws_json1_1UpdateBudgetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1595,7 +1595,7 @@ const deserializeAws_json1_1UpdateBudgetActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1651,7 +1651,7 @@ const deserializeAws_json1_1UpdateNotificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1707,7 +1707,7 @@ const deserializeAws_json1_1UpdateSubscriberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3136,6 +3136,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts index 0ee3303d7040..62a41ce5d9cd 100644 --- a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts @@ -892,7 +892,7 @@ const deserializeAws_restJson1CreateAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -957,7 +957,7 @@ const deserializeAws_restJson1CreateAppInstanceAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1019,7 +1019,7 @@ const deserializeAws_restJson1CreateAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1078,7 +1078,7 @@ const deserializeAws_restJson1DeleteAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1134,7 +1134,7 @@ const deserializeAws_restJson1DeleteAppInstanceAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1193,7 +1193,7 @@ const deserializeAws_restJson1DeleteAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1252,7 +1252,7 @@ const deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1308,7 +1308,7 @@ const deserializeAws_restJson1DescribeAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1364,7 +1364,7 @@ const deserializeAws_restJson1DescribeAppInstanceAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1420,7 +1420,7 @@ const deserializeAws_restJson1DescribeAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1543,7 +1543,7 @@ const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1605,7 +1605,7 @@ const deserializeAws_restJson1ListAppInstanceAdminsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1667,7 +1667,7 @@ const deserializeAws_restJson1ListAppInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1729,7 +1729,7 @@ const deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1791,7 +1791,7 @@ const deserializeAws_restJson1ListAppInstanceUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1847,7 +1847,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1911,7 +1911,7 @@ const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1970,7 +1970,7 @@ const deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2029,7 +2029,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2085,7 +2085,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2141,7 +2141,7 @@ const deserializeAws_restJson1UpdateAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2200,7 +2200,7 @@ const deserializeAws_restJson1UpdateAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2265,7 +2265,7 @@ const deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2770,6 +2770,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts index 092899c3f748..e99970cb052d 100644 --- a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts @@ -459,7 +459,7 @@ const deserializeAws_restJson1CreateMediaCapturePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -521,7 +521,7 @@ const deserializeAws_restJson1CreateMediaConcatenationPipelineCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -583,7 +583,7 @@ const deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -639,7 +639,7 @@ const deserializeAws_restJson1DeleteMediaCapturePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -695,7 +695,7 @@ const deserializeAws_restJson1DeleteMediaPipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -754,7 +754,7 @@ const deserializeAws_restJson1GetMediaCapturePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -813,7 +813,7 @@ const deserializeAws_restJson1GetMediaPipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -878,7 +878,7 @@ const deserializeAws_restJson1ListMediaCapturePipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -940,7 +940,7 @@ const deserializeAws_restJson1ListMediaPipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -999,7 +999,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1055,7 +1055,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1111,7 +1111,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2297,6 +2297,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts index d1a851374655..fb88e0d83d88 100644 --- a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts @@ -575,7 +575,7 @@ const deserializeAws_restJson1BatchCreateAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -637,7 +637,7 @@ const deserializeAws_restJson1BatchUpdateAttendeeCapabilitiesExceptCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -693,7 +693,7 @@ const deserializeAws_restJson1CreateAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -758,7 +758,7 @@ const deserializeAws_restJson1CreateMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -823,7 +823,7 @@ const deserializeAws_restJson1CreateMeetingWithAttendeesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -879,7 +879,7 @@ const deserializeAws_restJson1DeleteAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -935,7 +935,7 @@ const deserializeAws_restJson1DeleteMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -994,7 +994,7 @@ const deserializeAws_restJson1GetAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1053,7 +1053,7 @@ const deserializeAws_restJson1GetMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1115,7 +1115,7 @@ const deserializeAws_restJson1ListAttendeesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1174,7 +1174,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1212,7 +1212,7 @@ const deserializeAws_restJson1StartMeetingTranscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1274,7 +1274,7 @@ const deserializeAws_restJson1StopMeetingTranscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1333,7 +1333,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1377,7 +1377,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1421,7 +1421,7 @@ const deserializeAws_restJson1UpdateAttendeeCapabilitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2063,6 +2063,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts index 10b114d0bf23..a34d372f32bb 100644 --- a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts @@ -1581,7 +1581,7 @@ const deserializeAws_restJson1AssociateChannelFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1649,7 +1649,7 @@ const deserializeAws_restJson1BatchCreateChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1714,7 +1714,7 @@ const deserializeAws_restJson1ChannelFlowCallbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1773,7 +1773,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1838,7 +1838,7 @@ const deserializeAws_restJson1CreateChannelBanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1900,7 +1900,7 @@ const deserializeAws_restJson1CreateChannelFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1968,7 +1968,7 @@ const deserializeAws_restJson1CreateChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2036,7 +2036,7 @@ const deserializeAws_restJson1CreateChannelModeratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2095,7 +2095,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2148,7 +2148,7 @@ const deserializeAws_restJson1DeleteChannelBanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2201,7 +2201,7 @@ const deserializeAws_restJson1DeleteChannelFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2257,7 +2257,7 @@ const deserializeAws_restJson1DeleteChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2313,7 +2313,7 @@ const deserializeAws_restJson1DeleteChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2366,7 +2366,7 @@ const deserializeAws_restJson1DeleteChannelModeratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2422,7 +2422,7 @@ const deserializeAws_restJson1DescribeChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2478,7 +2478,7 @@ const deserializeAws_restJson1DescribeChannelBanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2537,7 +2537,7 @@ const deserializeAws_restJson1DescribeChannelFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2593,7 +2593,7 @@ const deserializeAws_restJson1DescribeChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2655,7 +2655,7 @@ const deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2711,7 +2711,7 @@ const deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2767,7 +2767,7 @@ const deserializeAws_restJson1DescribeChannelModeratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2823,7 +2823,7 @@ const deserializeAws_restJson1DisassociateChannelFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2891,7 +2891,7 @@ const deserializeAws_restJson1GetChannelMembershipPreferencesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2947,7 +2947,7 @@ const deserializeAws_restJson1GetChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3006,7 +3006,7 @@ const deserializeAws_restJson1GetChannelMessageStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3062,7 +3062,7 @@ const deserializeAws_restJson1GetMessagingSessionEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3121,7 +3121,7 @@ const deserializeAws_restJson1ListChannelBansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3180,7 +3180,7 @@ const deserializeAws_restJson1ListChannelFlowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3245,7 +3245,7 @@ const deserializeAws_restJson1ListChannelMembershipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3307,7 +3307,7 @@ const deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3372,7 +3372,7 @@ const deserializeAws_restJson1ListChannelMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3434,7 +3434,7 @@ const deserializeAws_restJson1ListChannelModeratorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3493,7 +3493,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3552,7 +3552,7 @@ const deserializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3611,7 +3611,7 @@ const deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3673,7 +3673,7 @@ const deserializeAws_restJson1ListSubChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3729,7 +3729,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3791,7 +3791,7 @@ const deserializeAws_restJson1PutChannelMembershipPreferencesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3856,7 +3856,7 @@ const deserializeAws_restJson1RedactChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3918,7 +3918,7 @@ const deserializeAws_restJson1SearchChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3983,7 +3983,7 @@ const deserializeAws_restJson1SendChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4039,7 +4039,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4095,7 +4095,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4151,7 +4151,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4210,7 +4210,7 @@ const deserializeAws_restJson1UpdateChannelFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4278,7 +4278,7 @@ const deserializeAws_restJson1UpdateChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4340,7 +4340,7 @@ const deserializeAws_restJson1UpdateChannelReadMarkerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5378,6 +5378,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-chime/src/protocols/Aws_restJson1.ts b/clients/client-chime/src/protocols/Aws_restJson1.ts index 8711af4f56e7..46334193f2c2 100644 --- a/clients/client-chime/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime/src/protocols/Aws_restJson1.ts @@ -6592,7 +6592,7 @@ const deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6654,7 +6654,7 @@ const deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6713,7 +6713,7 @@ const deserializeAws_restJson1AssociatePhoneNumberWithUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6772,7 +6772,7 @@ const deserializeAws_restJson1AssociateSigninDelegateGroupsWithAccountCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6834,7 +6834,7 @@ const deserializeAws_restJson1BatchCreateAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6902,7 +6902,7 @@ const deserializeAws_restJson1BatchCreateChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6958,7 +6958,7 @@ const deserializeAws_restJson1BatchCreateRoomMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7017,7 +7017,7 @@ const deserializeAws_restJson1BatchDeletePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7076,7 +7076,7 @@ const deserializeAws_restJson1BatchSuspendUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7135,7 +7135,7 @@ const deserializeAws_restJson1BatchUnsuspendUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7194,7 +7194,7 @@ const deserializeAws_restJson1BatchUpdatePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7253,7 +7253,7 @@ const deserializeAws_restJson1BatchUpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7312,7 +7312,7 @@ const deserializeAws_restJson1CreateAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7371,7 +7371,7 @@ const deserializeAws_restJson1CreateAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7436,7 +7436,7 @@ const deserializeAws_restJson1CreateAppInstanceAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7498,7 +7498,7 @@ const deserializeAws_restJson1CreateAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7560,7 +7560,7 @@ const deserializeAws_restJson1CreateAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7622,7 +7622,7 @@ const deserializeAws_restJson1CreateBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7684,7 +7684,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7749,7 +7749,7 @@ const deserializeAws_restJson1CreateChannelBanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7814,7 +7814,7 @@ const deserializeAws_restJson1CreateChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7879,7 +7879,7 @@ const deserializeAws_restJson1CreateChannelModeratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7941,7 +7941,7 @@ const deserializeAws_restJson1CreateMediaCapturePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8000,7 +8000,7 @@ const deserializeAws_restJson1CreateMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8059,7 +8059,7 @@ const deserializeAws_restJson1CreateMeetingDialOutCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8127,7 +8127,7 @@ const deserializeAws_restJson1CreateMeetingWithAttendeesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8186,7 +8186,7 @@ const deserializeAws_restJson1CreatePhoneNumberOrderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8248,7 +8248,7 @@ const deserializeAws_restJson1CreateProxySessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8307,7 +8307,7 @@ const deserializeAws_restJson1CreateRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8369,7 +8369,7 @@ const deserializeAws_restJson1CreateRoomMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8434,7 +8434,7 @@ const deserializeAws_restJson1CreateSipMediaApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8502,7 +8502,7 @@ const deserializeAws_restJson1CreateSipMediaApplicationCallCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8564,7 +8564,7 @@ const deserializeAws_restJson1CreateSipRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8629,7 +8629,7 @@ const deserializeAws_restJson1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8691,7 +8691,7 @@ const deserializeAws_restJson1CreateVoiceConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8753,7 +8753,7 @@ const deserializeAws_restJson1CreateVoiceConnectorGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8812,7 +8812,7 @@ const deserializeAws_restJson1DeleteAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8871,7 +8871,7 @@ const deserializeAws_restJson1DeleteAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8924,7 +8924,7 @@ const deserializeAws_restJson1DeleteAppInstanceAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8980,7 +8980,7 @@ const deserializeAws_restJson1DeleteAppInstanceStreamingConfigurationsCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9036,7 +9036,7 @@ const deserializeAws_restJson1DeleteAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9089,7 +9089,7 @@ const deserializeAws_restJson1DeleteAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9145,7 +9145,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9198,7 +9198,7 @@ const deserializeAws_restJson1DeleteChannelBanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9251,7 +9251,7 @@ const deserializeAws_restJson1DeleteChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9307,7 +9307,7 @@ const deserializeAws_restJson1DeleteChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9360,7 +9360,7 @@ const deserializeAws_restJson1DeleteChannelModeratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9413,7 +9413,7 @@ const deserializeAws_restJson1DeleteEventsConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9466,7 +9466,7 @@ const deserializeAws_restJson1DeleteMediaCapturePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9522,7 +9522,7 @@ const deserializeAws_restJson1DeleteMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9578,7 +9578,7 @@ const deserializeAws_restJson1DeletePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9634,7 +9634,7 @@ const deserializeAws_restJson1DeleteProxySessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9690,7 +9690,7 @@ const deserializeAws_restJson1DeleteRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9746,7 +9746,7 @@ const deserializeAws_restJson1DeleteRoomMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9802,7 +9802,7 @@ const deserializeAws_restJson1DeleteSipMediaApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9861,7 +9861,7 @@ const deserializeAws_restJson1DeleteSipRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9920,7 +9920,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9979,7 +9979,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationC ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10035,7 +10035,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10094,7 +10094,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorOriginationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10150,7 +10150,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorProxyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10206,7 +10206,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10262,7 +10262,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorTerminationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10318,7 +10318,7 @@ const deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10377,7 +10377,7 @@ const deserializeAws_restJson1DescribeAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10433,7 +10433,7 @@ const deserializeAws_restJson1DescribeAppInstanceAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10489,7 +10489,7 @@ const deserializeAws_restJson1DescribeAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10545,7 +10545,7 @@ const deserializeAws_restJson1DescribeChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10601,7 +10601,7 @@ const deserializeAws_restJson1DescribeChannelBanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10660,7 +10660,7 @@ const deserializeAws_restJson1DescribeChannelMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10722,7 +10722,7 @@ const deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10778,7 +10778,7 @@ const deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10834,7 +10834,7 @@ const deserializeAws_restJson1DescribeChannelModeratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10890,7 +10890,7 @@ const deserializeAws_restJson1DisassociatePhoneNumberFromUserCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10949,7 +10949,7 @@ const deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11008,7 +11008,7 @@ const deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCom ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11064,7 +11064,7 @@ const deserializeAws_restJson1DisassociateSigninDelegateGroupsFromAccountCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11123,7 +11123,7 @@ const deserializeAws_restJson1GetAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11182,7 +11182,7 @@ const deserializeAws_restJson1GetAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11249,7 +11249,7 @@ const deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11311,7 +11311,7 @@ const deserializeAws_restJson1GetAppInstanceStreamingConfigurationsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11370,7 +11370,7 @@ const deserializeAws_restJson1GetAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11429,7 +11429,7 @@ const deserializeAws_restJson1GetBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11488,7 +11488,7 @@ const deserializeAws_restJson1GetChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11547,7 +11547,7 @@ const deserializeAws_restJson1GetEventsConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11609,7 +11609,7 @@ const deserializeAws_restJson1GetGlobalSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11665,7 +11665,7 @@ const deserializeAws_restJson1GetMediaCapturePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11724,7 +11724,7 @@ const deserializeAws_restJson1GetMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11783,7 +11783,7 @@ const deserializeAws_restJson1GetMessagingSessionEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11836,7 +11836,7 @@ const deserializeAws_restJson1GetPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11895,7 +11895,7 @@ const deserializeAws_restJson1GetPhoneNumberOrderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11957,7 +11957,7 @@ const deserializeAws_restJson1GetPhoneNumberSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12013,7 +12013,7 @@ const deserializeAws_restJson1GetProxySessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12075,7 +12075,7 @@ const deserializeAws_restJson1GetRetentionSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12134,7 +12134,7 @@ const deserializeAws_restJson1GetRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12193,7 +12193,7 @@ const deserializeAws_restJson1GetSipMediaApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12255,7 +12255,7 @@ const deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12314,7 +12314,7 @@ const deserializeAws_restJson1GetSipRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12373,7 +12373,7 @@ const deserializeAws_restJson1GetUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12432,7 +12432,7 @@ const deserializeAws_restJson1GetUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12491,7 +12491,7 @@ const deserializeAws_restJson1GetVoiceConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12553,7 +12553,7 @@ const deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationComm ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12612,7 +12612,7 @@ const deserializeAws_restJson1GetVoiceConnectorGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12671,7 +12671,7 @@ const deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12730,7 +12730,7 @@ const deserializeAws_restJson1GetVoiceConnectorOriginationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12789,7 +12789,7 @@ const deserializeAws_restJson1GetVoiceConnectorProxyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12851,7 +12851,7 @@ const deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12910,7 +12910,7 @@ const deserializeAws_restJson1GetVoiceConnectorTerminationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12969,7 +12969,7 @@ const deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13028,7 +13028,7 @@ const deserializeAws_restJson1InviteUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13090,7 +13090,7 @@ const deserializeAws_restJson1ListAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13155,7 +13155,7 @@ const deserializeAws_restJson1ListAppInstanceAdminsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13214,7 +13214,7 @@ const deserializeAws_restJson1ListAppInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13276,7 +13276,7 @@ const deserializeAws_restJson1ListAppInstanceUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13335,7 +13335,7 @@ const deserializeAws_restJson1ListAttendeesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13394,7 +13394,7 @@ const deserializeAws_restJson1ListAttendeeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13456,7 +13456,7 @@ const deserializeAws_restJson1ListBotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13521,7 +13521,7 @@ const deserializeAws_restJson1ListChannelBansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13586,7 +13586,7 @@ const deserializeAws_restJson1ListChannelMembershipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13648,7 +13648,7 @@ const deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13710,7 +13710,7 @@ const deserializeAws_restJson1ListChannelMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13772,7 +13772,7 @@ const deserializeAws_restJson1ListChannelModeratorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13831,7 +13831,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13890,7 +13890,7 @@ const deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13952,7 +13952,7 @@ const deserializeAws_restJson1ListMediaCapturePipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14011,7 +14011,7 @@ const deserializeAws_restJson1ListMeetingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14067,7 +14067,7 @@ const deserializeAws_restJson1ListMeetingTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14129,7 +14129,7 @@ const deserializeAws_restJson1ListPhoneNumberOrdersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14188,7 +14188,7 @@ const deserializeAws_restJson1ListPhoneNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14250,7 +14250,7 @@ const deserializeAws_restJson1ListProxySessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14312,7 +14312,7 @@ const deserializeAws_restJson1ListRoomMembershipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14374,7 +14374,7 @@ const deserializeAws_restJson1ListRoomsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14436,7 +14436,7 @@ const deserializeAws_restJson1ListSipMediaApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14495,7 +14495,7 @@ const deserializeAws_restJson1ListSipRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14554,7 +14554,7 @@ const deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14613,7 +14613,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14672,7 +14672,7 @@ const deserializeAws_restJson1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14734,7 +14734,7 @@ const deserializeAws_restJson1ListVoiceConnectorGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14793,7 +14793,7 @@ const deserializeAws_restJson1ListVoiceConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14849,7 +14849,7 @@ const deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14905,7 +14905,7 @@ const deserializeAws_restJson1LogoutUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14972,7 +14972,7 @@ const deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15037,7 +15037,7 @@ const deserializeAws_restJson1PutAppInstanceStreamingConfigurationsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15096,7 +15096,7 @@ const deserializeAws_restJson1PutEventsConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15158,7 +15158,7 @@ const deserializeAws_restJson1PutRetentionSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15223,7 +15223,7 @@ const deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15285,7 +15285,7 @@ const deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationComm ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15344,7 +15344,7 @@ const deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15403,7 +15403,7 @@ const deserializeAws_restJson1PutVoiceConnectorOriginationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15462,7 +15462,7 @@ const deserializeAws_restJson1PutVoiceConnectorProxyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15527,7 +15527,7 @@ const deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15586,7 +15586,7 @@ const deserializeAws_restJson1PutVoiceConnectorTerminationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15645,7 +15645,7 @@ const deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15707,7 +15707,7 @@ const deserializeAws_restJson1RedactChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15760,7 +15760,7 @@ const deserializeAws_restJson1RedactConversationMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15816,7 +15816,7 @@ const deserializeAws_restJson1RedactRoomMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15875,7 +15875,7 @@ const deserializeAws_restJson1RegenerateSecurityTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15934,7 +15934,7 @@ const deserializeAws_restJson1ResetPersonalPINCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15993,7 +15993,7 @@ const deserializeAws_restJson1RestorePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16058,7 +16058,7 @@ const deserializeAws_restJson1SearchAvailablePhoneNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16120,7 +16120,7 @@ const deserializeAws_restJson1SendChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16176,7 +16176,7 @@ const deserializeAws_restJson1StartMeetingTranscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16238,7 +16238,7 @@ const deserializeAws_restJson1StopMeetingTranscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16297,7 +16297,7 @@ const deserializeAws_restJson1TagAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16356,7 +16356,7 @@ const deserializeAws_restJson1TagMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16415,7 +16415,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16468,7 +16468,7 @@ const deserializeAws_restJson1UntagAttendeeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16524,7 +16524,7 @@ const deserializeAws_restJson1UntagMeetingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16580,7 +16580,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16636,7 +16636,7 @@ const deserializeAws_restJson1UpdateAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16692,7 +16692,7 @@ const deserializeAws_restJson1UpdateAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16754,7 +16754,7 @@ const deserializeAws_restJson1UpdateAppInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16813,7 +16813,7 @@ const deserializeAws_restJson1UpdateAppInstanceUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16872,7 +16872,7 @@ const deserializeAws_restJson1UpdateBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16931,7 +16931,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16993,7 +16993,7 @@ const deserializeAws_restJson1UpdateChannelMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17052,7 +17052,7 @@ const deserializeAws_restJson1UpdateChannelReadMarkerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17108,7 +17108,7 @@ const deserializeAws_restJson1UpdateGlobalSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17164,7 +17164,7 @@ const deserializeAws_restJson1UpdatePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17223,7 +17223,7 @@ const deserializeAws_restJson1UpdatePhoneNumberSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17279,7 +17279,7 @@ const deserializeAws_restJson1UpdateProxySessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17338,7 +17338,7 @@ const deserializeAws_restJson1UpdateRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17397,7 +17397,7 @@ const deserializeAws_restJson1UpdateRoomMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17456,7 +17456,7 @@ const deserializeAws_restJson1UpdateSipMediaApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17521,7 +17521,7 @@ const deserializeAws_restJson1UpdateSipMediaApplicationCallCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17583,7 +17583,7 @@ const deserializeAws_restJson1UpdateSipRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17648,7 +17648,7 @@ const deserializeAws_restJson1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17704,7 +17704,7 @@ const deserializeAws_restJson1UpdateUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17763,7 +17763,7 @@ const deserializeAws_restJson1UpdateVoiceConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17822,7 +17822,7 @@ const deserializeAws_restJson1UpdateVoiceConnectorGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17893,7 +17893,7 @@ const deserializeAws_restJson1ValidateE911AddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20703,6 +20703,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloud9/src/protocols/Aws_json1_1.ts b/clients/client-cloud9/src/protocols/Aws_json1_1.ts index 7377f6bf30af..f3b43ccfd9a8 100644 --- a/clients/client-cloud9/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/src/protocols/Aws_json1_1.ts @@ -288,7 +288,7 @@ const deserializeAws_json1_1CreateEnvironmentEC2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -347,7 +347,7 @@ const deserializeAws_json1_1CreateEnvironmentMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -406,7 +406,7 @@ const deserializeAws_json1_1DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -465,7 +465,7 @@ const deserializeAws_json1_1DeleteEnvironmentMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -524,7 +524,7 @@ const deserializeAws_json1_1DescribeEnvironmentMembershipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -583,7 +583,7 @@ const deserializeAws_json1_1DescribeEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -642,7 +642,7 @@ const deserializeAws_json1_1DescribeEnvironmentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -701,7 +701,7 @@ const deserializeAws_json1_1ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -760,7 +760,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -807,7 +807,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -857,7 +857,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -907,7 +907,7 @@ const deserializeAws_json1_1UpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -966,7 +966,7 @@ const deserializeAws_json1_1UpdateEnvironmentMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1604,6 +1604,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts index 99405b777864..ba66702e98c4 100644 --- a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts +++ b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts @@ -206,7 +206,7 @@ const deserializeAws_json1_0CancelResourceRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -250,7 +250,7 @@ const deserializeAws_json1_0CreateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -345,7 +345,7 @@ const deserializeAws_json1_0DeleteResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -440,7 +440,7 @@ const deserializeAws_json1_0GetResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -529,7 +529,7 @@ const deserializeAws_json1_0GetResourceRequestStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -570,7 +570,7 @@ const deserializeAws_json1_0ListResourceRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -605,7 +605,7 @@ const deserializeAws_json1_0ListResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -694,7 +694,7 @@ const deserializeAws_json1_0UpdateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1501,6 +1501,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts index e51fa6d22fbb..f47b96948483 100644 --- a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts +++ b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts @@ -2270,7 +2270,7 @@ const deserializeAws_restJson1AddFacetToObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2338,7 +2338,7 @@ const deserializeAws_restJson1ApplySchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2403,7 +2403,7 @@ const deserializeAws_restJson1AttachObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2471,7 +2471,7 @@ const deserializeAws_restJson1AttachPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2536,7 +2536,7 @@ const deserializeAws_restJson1AttachToIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2610,7 +2610,7 @@ const deserializeAws_restJson1AttachTypedLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2678,7 +2678,7 @@ const deserializeAws_restJson1BatchReadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2737,7 +2737,7 @@ const deserializeAws_restJson1BatchWriteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2808,7 +2808,7 @@ const deserializeAws_restJson1CreateDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2867,7 +2867,7 @@ const deserializeAws_restJson1CreateFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2935,7 +2935,7 @@ const deserializeAws_restJson1CreateIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3006,7 +3006,7 @@ const deserializeAws_restJson1CreateObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3077,7 +3077,7 @@ const deserializeAws_restJson1CreateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3133,7 +3133,7 @@ const deserializeAws_restJson1CreateTypedLinkFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3201,7 +3201,7 @@ const deserializeAws_restJson1DeleteDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3263,7 +3263,7 @@ const deserializeAws_restJson1DeleteFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3325,7 +3325,7 @@ const deserializeAws_restJson1DeleteObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3390,7 +3390,7 @@ const deserializeAws_restJson1DeleteSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3449,7 +3449,7 @@ const deserializeAws_restJson1DeleteTypedLinkFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3511,7 +3511,7 @@ const deserializeAws_restJson1DetachFromIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3579,7 +3579,7 @@ const deserializeAws_restJson1DetachObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3641,7 +3641,7 @@ const deserializeAws_restJson1DetachPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3703,7 +3703,7 @@ const deserializeAws_restJson1DetachTypedLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3768,7 +3768,7 @@ const deserializeAws_restJson1DisableDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3830,7 +3830,7 @@ const deserializeAws_restJson1EnableDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3892,7 +3892,7 @@ const deserializeAws_restJson1GetAppliedSchemaVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3951,7 +3951,7 @@ const deserializeAws_restJson1GetDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4007,7 +4007,7 @@ const deserializeAws_restJson1GetFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4069,7 +4069,7 @@ const deserializeAws_restJson1GetLinkAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4134,7 +4134,7 @@ const deserializeAws_restJson1GetObjectAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4202,7 +4202,7 @@ const deserializeAws_restJson1GetObjectInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4267,7 +4267,7 @@ const deserializeAws_restJson1GetSchemaAsJsonCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4326,7 +4326,7 @@ const deserializeAws_restJson1GetTypedLinkFacetInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4394,7 +4394,7 @@ const deserializeAws_restJson1ListAppliedSchemaArnsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4459,7 +4459,7 @@ const deserializeAws_restJson1ListAttachedIndicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4524,7 +4524,7 @@ const deserializeAws_restJson1ListDevelopmentSchemaArnsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4589,7 +4589,7 @@ const deserializeAws_restJson1ListDirectoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4651,7 +4651,7 @@ const deserializeAws_restJson1ListFacetAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4719,7 +4719,7 @@ const deserializeAws_restJson1ListFacetNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4784,7 +4784,7 @@ const deserializeAws_restJson1ListIncomingTypedLinksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4855,7 +4855,7 @@ const deserializeAws_restJson1ListIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4929,7 +4929,7 @@ const deserializeAws_restJson1ListManagedSchemaArnsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4988,7 +4988,7 @@ const deserializeAws_restJson1ListObjectAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5059,7 +5059,7 @@ const deserializeAws_restJson1ListObjectChildrenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5133,7 +5133,7 @@ const deserializeAws_restJson1ListObjectParentPathsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5204,7 +5204,7 @@ const deserializeAws_restJson1ListObjectParentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5275,7 +5275,7 @@ const deserializeAws_restJson1ListObjectPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5343,7 +5343,7 @@ const deserializeAws_restJson1ListOutgoingTypedLinksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5414,7 +5414,7 @@ const deserializeAws_restJson1ListPolicyAttachmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5485,7 +5485,7 @@ const deserializeAws_restJson1ListPublishedSchemaArnsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5550,7 +5550,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5615,7 +5615,7 @@ const deserializeAws_restJson1ListTypedLinkFacetAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5683,7 +5683,7 @@ const deserializeAws_restJson1ListTypedLinkFacetNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5748,7 +5748,7 @@ const deserializeAws_restJson1LookupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5813,7 +5813,7 @@ const deserializeAws_restJson1PublishSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5875,7 +5875,7 @@ const deserializeAws_restJson1PutSchemaFromJsonCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5934,7 +5934,7 @@ const deserializeAws_restJson1RemoveFacetFromObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5996,7 +5996,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6055,7 +6055,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6114,7 +6114,7 @@ const deserializeAws_restJson1UpdateFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6182,7 +6182,7 @@ const deserializeAws_restJson1UpdateLinkAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6247,7 +6247,7 @@ const deserializeAws_restJson1UpdateObjectAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6315,7 +6315,7 @@ const deserializeAws_restJson1UpdateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6371,7 +6371,7 @@ const deserializeAws_restJson1UpdateTypedLinkFacetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6445,7 +6445,7 @@ const deserializeAws_restJson1UpgradeAppliedSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6510,7 +6510,7 @@ const deserializeAws_restJson1UpgradePublishedSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9050,6 +9050,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudformation/src/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts index 530ab74b4e1e..97e595f366bf 100644 --- a/clients/client-cloudformation/src/protocols/Aws_query.ts +++ b/clients/client-cloudformation/src/protocols/Aws_query.ts @@ -1464,7 +1464,7 @@ const deserializeAws_queryActivateTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1511,7 +1511,7 @@ const deserializeAws_queryBatchDescribeTypeConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1552,7 +1552,7 @@ const deserializeAws_queryCancelUpdateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1593,7 +1593,7 @@ const deserializeAws_queryContinueUpdateRollbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1634,7 +1634,7 @@ const deserializeAws_queryCreateChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1681,7 +1681,7 @@ const deserializeAws_queryCreateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1731,7 +1731,7 @@ const deserializeAws_queryCreateStackInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1787,7 +1787,7 @@ const deserializeAws_queryCreateStackSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1834,7 +1834,7 @@ const deserializeAws_queryDeactivateTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1878,7 +1878,7 @@ const deserializeAws_queryDeleteChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1916,7 +1916,7 @@ const deserializeAws_queryDeleteStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1957,7 +1957,7 @@ const deserializeAws_queryDeleteStackInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2010,7 +2010,7 @@ const deserializeAws_queryDeleteStackSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2054,7 +2054,7 @@ const deserializeAws_queryDeregisterTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2098,7 +2098,7 @@ const deserializeAws_queryDescribeAccountLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2133,7 +2133,7 @@ const deserializeAws_queryDescribeChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2174,7 +2174,7 @@ const deserializeAws_queryDescribeChangeSetHooksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2215,7 +2215,7 @@ const deserializeAws_queryDescribePublisherCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2259,7 +2259,7 @@ const deserializeAws_queryDescribeStackDriftDetectionStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2294,7 +2294,7 @@ const deserializeAws_queryDescribeStackEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2329,7 +2329,7 @@ const deserializeAws_queryDescribeStackInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2373,7 +2373,7 @@ const deserializeAws_queryDescribeStackResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2408,7 +2408,7 @@ const deserializeAws_queryDescribeStackResourceDriftsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2443,7 +2443,7 @@ const deserializeAws_queryDescribeStackResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2478,7 +2478,7 @@ const deserializeAws_queryDescribeStacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2513,7 +2513,7 @@ const deserializeAws_queryDescribeStackSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2554,7 +2554,7 @@ const deserializeAws_queryDescribeStackSetOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2598,7 +2598,7 @@ const deserializeAws_queryDescribeTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2642,7 +2642,7 @@ const deserializeAws_queryDescribeTypeRegistrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2683,7 +2683,7 @@ const deserializeAws_queryDetectStackDriftCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2718,7 +2718,7 @@ const deserializeAws_queryDetectStackResourceDriftCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2753,7 +2753,7 @@ const deserializeAws_queryDetectStackSetDriftCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2800,7 +2800,7 @@ const deserializeAws_queryEstimateTemplateCostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2835,7 +2835,7 @@ const deserializeAws_queryExecuteChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2885,7 +2885,7 @@ const deserializeAws_queryGetStackPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2920,7 +2920,7 @@ const deserializeAws_queryGetTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2961,7 +2961,7 @@ const deserializeAws_queryGetTemplateSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3002,7 +3002,7 @@ const deserializeAws_queryImportStacksToStackSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3061,7 +3061,7 @@ const deserializeAws_queryListChangeSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3096,7 +3096,7 @@ const deserializeAws_queryListExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3131,7 +3131,7 @@ const deserializeAws_queryListImportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3166,7 +3166,7 @@ const deserializeAws_queryListStackInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3207,7 +3207,7 @@ const deserializeAws_queryListStackResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3242,7 +3242,7 @@ const deserializeAws_queryListStacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3277,7 +3277,7 @@ const deserializeAws_queryListStackSetOperationResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3321,7 +3321,7 @@ const deserializeAws_queryListStackSetOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3362,7 +3362,7 @@ const deserializeAws_queryListStackSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3397,7 +3397,7 @@ const deserializeAws_queryListTypeRegistrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3438,7 +3438,7 @@ const deserializeAws_queryListTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3479,7 +3479,7 @@ const deserializeAws_queryListTypeVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3520,7 +3520,7 @@ const deserializeAws_queryPublishTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3564,7 +3564,7 @@ const deserializeAws_queryRecordHandlerProgressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3608,7 +3608,7 @@ const deserializeAws_queryRegisterPublisherCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3649,7 +3649,7 @@ const deserializeAws_queryRegisterTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3690,7 +3690,7 @@ const deserializeAws_queryRollbackStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3728,7 +3728,7 @@ const deserializeAws_querySetStackPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3763,7 +3763,7 @@ const deserializeAws_querySetTypeConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3807,7 +3807,7 @@ const deserializeAws_querySetTypeDefaultVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3848,7 +3848,7 @@ const deserializeAws_querySignalResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3883,7 +3883,7 @@ const deserializeAws_queryStopStackSetOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3930,7 +3930,7 @@ const deserializeAws_queryTestTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3974,7 +3974,7 @@ const deserializeAws_queryUpdateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4018,7 +4018,7 @@ const deserializeAws_queryUpdateStackInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4074,7 +4074,7 @@ const deserializeAws_queryUpdateStackSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4130,7 +4130,7 @@ const deserializeAws_queryUpdateTerminationProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4165,7 +4165,7 @@ const deserializeAws_queryValidateTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10266,6 +10266,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-cloudfront/src/protocols/Aws_restXml.ts b/clients/client-cloudfront/src/protocols/Aws_restXml.ts index 8e64d99aca83..2fb7f914708b 100644 --- a/clients/client-cloudfront/src/protocols/Aws_restXml.ts +++ b/clients/client-cloudfront/src/protocols/Aws_restXml.ts @@ -3429,7 +3429,7 @@ const deserializeAws_restXmlAssociateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3482,7 +3482,7 @@ const deserializeAws_restXmlCreateCachePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3544,7 +3544,7 @@ const deserializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3597,7 +3597,7 @@ const deserializeAws_restXmlCreateDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3839,7 +3839,7 @@ const deserializeAws_restXmlCreateDistributionWithTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4075,7 +4075,7 @@ const deserializeAws_restXmlCreateFieldLevelEncryptionConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4137,7 +4137,7 @@ const deserializeAws_restXmlCreateFieldLevelEncryptionProfileCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4199,7 +4199,7 @@ const deserializeAws_restXmlCreateFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4251,7 +4251,7 @@ const deserializeAws_restXmlCreateInvalidationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4310,7 +4310,7 @@ const deserializeAws_restXmlCreateKeyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4358,7 +4358,7 @@ const deserializeAws_restXmlCreateMonitoringSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4408,7 +4408,7 @@ const deserializeAws_restXmlCreateOriginAccessControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4455,7 +4455,7 @@ const deserializeAws_restXmlCreateOriginRequestPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4517,7 +4517,7 @@ const deserializeAws_restXmlCreatePublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4564,7 +4564,7 @@ const deserializeAws_restXmlCreateRealtimeLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4614,7 +4614,7 @@ const deserializeAws_restXmlCreateResponseHeadersPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4673,7 +4673,7 @@ const deserializeAws_restXmlCreateStreamingDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4750,7 +4750,7 @@ const deserializeAws_restXmlCreateStreamingDistributionWithTagsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4827,7 +4827,7 @@ const deserializeAws_restXmlDeleteCachePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4880,7 +4880,7 @@ const deserializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4930,7 +4930,7 @@ const deserializeAws_restXmlDeleteDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4980,7 +4980,7 @@ const deserializeAws_restXmlDeleteFieldLevelEncryptionConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5030,7 +5030,7 @@ const deserializeAws_restXmlDeleteFieldLevelEncryptionProfileCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5080,7 +5080,7 @@ const deserializeAws_restXmlDeleteFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5130,7 +5130,7 @@ const deserializeAws_restXmlDeleteKeyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5177,7 +5177,7 @@ const deserializeAws_restXmlDeleteMonitoringSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5224,7 +5224,7 @@ const deserializeAws_restXmlDeleteOriginAccessControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5274,7 +5274,7 @@ const deserializeAws_restXmlDeleteOriginRequestPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5327,7 +5327,7 @@ const deserializeAws_restXmlDeletePublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5377,7 +5377,7 @@ const deserializeAws_restXmlDeleteRealtimeLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5424,7 +5424,7 @@ const deserializeAws_restXmlDeleteResponseHeadersPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5477,7 +5477,7 @@ const deserializeAws_restXmlDeleteStreamingDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5529,7 +5529,7 @@ const deserializeAws_restXmlDescribeFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5572,7 +5572,7 @@ const deserializeAws_restXmlGetCachePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5615,7 +5615,7 @@ const deserializeAws_restXmlGetCachePolicyConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5658,7 +5658,7 @@ const deserializeAws_restXmlGetCloudFrontOriginAccessIdentityCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5704,7 +5704,7 @@ const deserializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5747,7 +5747,7 @@ const deserializeAws_restXmlGetDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5790,7 +5790,7 @@ const deserializeAws_restXmlGetDistributionConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5833,7 +5833,7 @@ const deserializeAws_restXmlGetFieldLevelEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5876,7 +5876,7 @@ const deserializeAws_restXmlGetFieldLevelEncryptionConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5919,7 +5919,7 @@ const deserializeAws_restXmlGetFieldLevelEncryptionProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5962,7 +5962,7 @@ const deserializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6006,7 +6006,7 @@ const deserializeAws_restXmlGetFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6048,7 +6048,7 @@ const deserializeAws_restXmlGetInvalidationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6094,7 +6094,7 @@ const deserializeAws_restXmlGetKeyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6134,7 +6134,7 @@ const deserializeAws_restXmlGetKeyGroupConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6173,7 +6173,7 @@ const deserializeAws_restXmlGetMonitoringSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6222,7 +6222,7 @@ const deserializeAws_restXmlGetOriginAccessControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6265,7 +6265,7 @@ const deserializeAws_restXmlGetOriginAccessControlConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6308,7 +6308,7 @@ const deserializeAws_restXmlGetOriginRequestPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6351,7 +6351,7 @@ const deserializeAws_restXmlGetOriginRequestPolicyConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6394,7 +6394,7 @@ const deserializeAws_restXmlGetPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6437,7 +6437,7 @@ const deserializeAws_restXmlGetPublicKeyConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6481,7 +6481,7 @@ const deserializeAws_restXmlGetRealtimeLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6527,7 +6527,7 @@ const deserializeAws_restXmlGetResponseHeadersPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6570,7 +6570,7 @@ const deserializeAws_restXmlGetResponseHeadersPolicyConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6613,7 +6613,7 @@ const deserializeAws_restXmlGetStreamingDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6656,7 +6656,7 @@ const deserializeAws_restXmlGetStreamingDistributionConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6698,7 +6698,7 @@ const deserializeAws_restXmlListCachePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6743,7 +6743,7 @@ const deserializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6782,7 +6782,7 @@ const deserializeAws_restXmlListConflictingAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6824,7 +6824,7 @@ const deserializeAws_restXmlListDistributionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6863,7 +6863,7 @@ const deserializeAws_restXmlListDistributionsByCachePolicyIdCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6908,7 +6908,7 @@ const deserializeAws_restXmlListDistributionsByKeyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6950,7 +6950,7 @@ const deserializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6995,7 +6995,7 @@ const deserializeAws_restXmlListDistributionsByRealtimeLogConfigCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7034,7 +7034,7 @@ const deserializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7079,7 +7079,7 @@ const deserializeAws_restXmlListDistributionsByWebACLIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7121,7 +7121,7 @@ const deserializeAws_restXmlListFieldLevelEncryptionConfigsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7160,7 +7160,7 @@ const deserializeAws_restXmlListFieldLevelEncryptionProfilesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7199,7 +7199,7 @@ const deserializeAws_restXmlListFunctionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7241,7 +7241,7 @@ const deserializeAws_restXmlListInvalidationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7286,7 +7286,7 @@ const deserializeAws_restXmlListKeyGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7325,7 +7325,7 @@ const deserializeAws_restXmlListOriginAccessControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7364,7 +7364,7 @@ const deserializeAws_restXmlListOriginRequestPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7409,7 +7409,7 @@ const deserializeAws_restXmlListPublicKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7448,7 +7448,7 @@ const deserializeAws_restXmlListRealtimeLogConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7493,7 +7493,7 @@ const deserializeAws_restXmlListResponseHeadersPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7538,7 +7538,7 @@ const deserializeAws_restXmlListStreamingDistributionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7577,7 +7577,7 @@ const deserializeAws_restXmlListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7625,7 +7625,7 @@ const deserializeAws_restXmlPublishFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7675,7 +7675,7 @@ const deserializeAws_restXmlTagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7723,7 +7723,7 @@ const deserializeAws_restXmlTestFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7773,7 +7773,7 @@ const deserializeAws_restXmlUntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7822,7 +7822,7 @@ const deserializeAws_restXmlUpdateCachePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7892,7 +7892,7 @@ const deserializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7953,7 +7953,7 @@ const deserializeAws_restXmlUpdateDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8188,7 +8188,7 @@ const deserializeAws_restXmlUpdateFieldLevelEncryptionConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8258,7 +8258,7 @@ const deserializeAws_restXmlUpdateFieldLevelEncryptionProfileCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8331,7 +8331,7 @@ const deserializeAws_restXmlUpdateFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8386,7 +8386,7 @@ const deserializeAws_restXmlUpdateKeyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8441,7 +8441,7 @@ const deserializeAws_restXmlUpdateOriginAccessControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8499,7 +8499,7 @@ const deserializeAws_restXmlUpdateOriginRequestPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8569,7 +8569,7 @@ const deserializeAws_restXmlUpdatePublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8628,7 +8628,7 @@ const deserializeAws_restXmlUpdateRealtimeLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8674,7 +8674,7 @@ const deserializeAws_restXmlUpdateResponseHeadersPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8741,7 +8741,7 @@ const deserializeAws_restXmlUpdateStreamingDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17288,6 +17288,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const loadRestXmlErrorCode = (output: __HttpResponse, data: any): string | undefined => { if (data.Error.Code !== undefined) { return data.Error.Code; diff --git a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts index 18349eed5628..55a6f3411e38 100644 --- a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts @@ -299,7 +299,7 @@ const deserializeAws_json1_1CopyBackupToRegionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -355,7 +355,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -411,7 +411,7 @@ const deserializeAws_json1_1CreateHsmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -464,7 +464,7 @@ const deserializeAws_json1_1DeleteBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -517,7 +517,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -573,7 +573,7 @@ const deserializeAws_json1_1DeleteHsmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -626,7 +626,7 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -682,7 +682,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -735,7 +735,7 @@ const deserializeAws_json1_1InitializeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -788,7 +788,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -844,7 +844,7 @@ const deserializeAws_json1_1ModifyBackupAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -897,7 +897,7 @@ const deserializeAws_json1_1ModifyClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -950,7 +950,7 @@ const deserializeAws_json1_1RestoreBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1003,7 +1003,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1730,6 +1730,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts index 6591b77d0c55..8803a248000e 100644 --- a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts @@ -370,7 +370,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -417,7 +417,7 @@ const deserializeAws_json1_1CreateHapgCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -464,7 +464,7 @@ const deserializeAws_json1_1CreateHsmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -511,7 +511,7 @@ const deserializeAws_json1_1CreateLunaClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -558,7 +558,7 @@ const deserializeAws_json1_1DeleteHapgCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -605,7 +605,7 @@ const deserializeAws_json1_1DeleteHsmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -652,7 +652,7 @@ const deserializeAws_json1_1DeleteLunaClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -699,7 +699,7 @@ const deserializeAws_json1_1DescribeHapgCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -746,7 +746,7 @@ const deserializeAws_json1_1DescribeHsmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -793,7 +793,7 @@ const deserializeAws_json1_1DescribeLunaClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -840,7 +840,7 @@ const deserializeAws_json1_1GetConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -887,7 +887,7 @@ const deserializeAws_json1_1ListAvailableZonesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_json1_1ListHapgsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -981,7 +981,7 @@ const deserializeAws_json1_1ListHsmsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1028,7 +1028,7 @@ const deserializeAws_json1_1ListLunaClientsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1075,7 +1075,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1122,7 +1122,7 @@ const deserializeAws_json1_1ModifyHapgCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1169,7 +1169,7 @@ const deserializeAws_json1_1ModifyHsmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1216,7 +1216,7 @@ const deserializeAws_json1_1ModifyLunaClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1257,7 +1257,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1885,6 +1885,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts index 10afd29af03e..f9eb5a3fc354 100644 --- a/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts @@ -162,7 +162,7 @@ const deserializeAws_restJson1SearchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -206,7 +206,7 @@ const deserializeAws_restJson1SuggestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -256,7 +256,7 @@ const deserializeAws_restJson1UploadDocumentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -551,6 +551,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudsearch/src/protocols/Aws_query.ts b/clients/client-cloudsearch/src/protocols/Aws_query.ts index 200e66a7a08a..9fc9f4a31ea3 100644 --- a/clients/client-cloudsearch/src/protocols/Aws_query.ts +++ b/clients/client-cloudsearch/src/protocols/Aws_query.ts @@ -620,7 +620,7 @@ const deserializeAws_queryBuildSuggestersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -670,7 +670,7 @@ const deserializeAws_queryCreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -723,7 +723,7 @@ const deserializeAws_queryDefineAnalysisSchemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -779,7 +779,7 @@ const deserializeAws_queryDefineExpressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -835,7 +835,7 @@ const deserializeAws_queryDefineIndexFieldCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -891,7 +891,7 @@ const deserializeAws_queryDefineSuggesterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -947,7 +947,7 @@ const deserializeAws_queryDeleteAnalysisSchemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1000,7 +1000,7 @@ const deserializeAws_queryDeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1044,7 +1044,7 @@ const deserializeAws_queryDeleteExpressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1097,7 +1097,7 @@ const deserializeAws_queryDeleteIndexFieldCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1150,7 +1150,7 @@ const deserializeAws_queryDeleteSuggesterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1203,7 +1203,7 @@ const deserializeAws_queryDescribeAnalysisSchemesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1250,7 +1250,7 @@ const deserializeAws_queryDescribeAvailabilityOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1309,7 +1309,7 @@ const deserializeAws_queryDescribeDomainEndpointOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1362,7 +1362,7 @@ const deserializeAws_queryDescribeDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1406,7 +1406,7 @@ const deserializeAws_queryDescribeExpressionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1453,7 +1453,7 @@ const deserializeAws_queryDescribeIndexFieldsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1500,7 +1500,7 @@ const deserializeAws_queryDescribeScalingParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1550,7 +1550,7 @@ const deserializeAws_queryDescribeServiceAccessPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1597,7 +1597,7 @@ const deserializeAws_queryDescribeSuggestersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1644,7 +1644,7 @@ const deserializeAws_queryIndexDocumentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1694,7 +1694,7 @@ const deserializeAws_queryListDomainNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1735,7 +1735,7 @@ const deserializeAws_queryUpdateAvailabilityOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1794,7 +1794,7 @@ const deserializeAws_queryUpdateDomainEndpointOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1853,7 +1853,7 @@ const deserializeAws_queryUpdateScalingParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1909,7 +1909,7 @@ const deserializeAws_queryUpdateServiceAccessPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4204,6 +4204,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts index b882b5e884f2..34a05dc4d158 100644 --- a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts @@ -732,7 +732,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -806,7 +806,7 @@ const deserializeAws_json1_1CancelQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -871,7 +871,7 @@ const deserializeAws_json1_1CreateEventDataStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -948,7 +948,7 @@ const deserializeAws_json1_1CreateTrailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1076,7 +1076,7 @@ const deserializeAws_json1_1DeleteEventDataStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1144,7 +1144,7 @@ const deserializeAws_json1_1DeleteTrailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1209,7 +1209,7 @@ const deserializeAws_json1_1DescribeQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1268,7 +1268,7 @@ const deserializeAws_json1_1DescribeTrailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1315,7 +1315,7 @@ const deserializeAws_json1_1GetChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1365,7 +1365,7 @@ const deserializeAws_json1_1GetEventDataStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1418,7 +1418,7 @@ const deserializeAws_json1_1GetEventSelectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1468,7 +1468,7 @@ const deserializeAws_json1_1GetImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1518,7 +1518,7 @@ const deserializeAws_json1_1GetInsightSelectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1571,7 +1571,7 @@ const deserializeAws_json1_1GetQueryResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1636,7 +1636,7 @@ const deserializeAws_json1_1GetTrailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1686,7 +1686,7 @@ const deserializeAws_json1_1GetTrailStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1736,7 +1736,7 @@ const deserializeAws_json1_1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1783,7 +1783,7 @@ const deserializeAws_json1_1ListEventDataStoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1833,7 +1833,7 @@ const deserializeAws_json1_1ListImportFailuresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1880,7 +1880,7 @@ const deserializeAws_json1_1ListImportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1933,7 +1933,7 @@ const deserializeAws_json1_1ListPublicKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1983,7 +1983,7 @@ const deserializeAws_json1_1ListQueriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2051,7 +2051,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2116,7 +2116,7 @@ const deserializeAws_json1_1ListTrailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2160,7 +2160,7 @@ const deserializeAws_json1_1LookupEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2219,7 +2219,7 @@ const deserializeAws_json1_1PutEventSelectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2284,7 +2284,7 @@ const deserializeAws_json1_1PutInsightSelectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2355,7 +2355,7 @@ const deserializeAws_json1_1RemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2423,7 +2423,7 @@ const deserializeAws_json1_1RestoreEventDataStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2500,7 +2500,7 @@ const deserializeAws_json1_1StartImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2571,7 +2571,7 @@ const deserializeAws_json1_1StartLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2633,7 +2633,7 @@ const deserializeAws_json1_1StartQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2695,7 +2695,7 @@ const deserializeAws_json1_1StopImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2745,7 +2745,7 @@ const deserializeAws_json1_1StopLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2807,7 +2807,7 @@ const deserializeAws_json1_1UpdateEventDataStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2884,7 +2884,7 @@ const deserializeAws_json1_1UpdateTrailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6048,6 +6048,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts index 34678b0db95f..55f04e2ea245 100644 --- a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts @@ -966,7 +966,7 @@ const deserializeAws_json1_1ActivateEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1019,7 +1019,7 @@ const deserializeAws_json1_1CancelReplayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1069,7 +1069,7 @@ const deserializeAws_json1_1CreateApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1119,7 +1119,7 @@ const deserializeAws_json1_1CreateArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1175,7 +1175,7 @@ const deserializeAws_json1_1CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1222,7 +1222,7 @@ const deserializeAws_json1_1CreateEventBusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1281,7 +1281,7 @@ const deserializeAws_json1_1CreatePartnerEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1331,7 +1331,7 @@ const deserializeAws_json1_1DeactivateEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1384,7 +1384,7 @@ const deserializeAws_json1_1DeauthorizeConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1431,7 +1431,7 @@ const deserializeAws_json1_1DeleteApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_json1_1DeleteArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1525,7 +1525,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1569,7 +1569,7 @@ const deserializeAws_json1_1DeleteEventBusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1610,7 +1610,7 @@ const deserializeAws_json1_1DeletePartnerEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1654,7 +1654,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1704,7 +1704,7 @@ const deserializeAws_json1_1DescribeApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1748,7 +1748,7 @@ const deserializeAws_json1_1DescribeArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1795,7 +1795,7 @@ const deserializeAws_json1_1DescribeConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1839,7 +1839,7 @@ const deserializeAws_json1_1DescribeEventBusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1883,7 +1883,7 @@ const deserializeAws_json1_1DescribeEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1930,7 +1930,7 @@ const deserializeAws_json1_1DescribePartnerEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1977,7 +1977,7 @@ const deserializeAws_json1_1DescribeReplayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2021,7 +2021,7 @@ const deserializeAws_json1_1DescribeRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2062,7 +2062,7 @@ const deserializeAws_json1_1DisableRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2109,7 +2109,7 @@ const deserializeAws_json1_1EnableRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2159,7 +2159,7 @@ const deserializeAws_json1_1ListApiDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2200,7 +2200,7 @@ const deserializeAws_json1_1ListArchivesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2244,7 +2244,7 @@ const deserializeAws_json1_1ListConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2285,7 +2285,7 @@ const deserializeAws_json1_1ListEventBusesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2326,7 +2326,7 @@ const deserializeAws_json1_1ListEventSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2370,7 +2370,7 @@ const deserializeAws_json1_1ListPartnerEventSourceAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2417,7 +2417,7 @@ const deserializeAws_json1_1ListPartnerEventSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2461,7 +2461,7 @@ const deserializeAws_json1_1ListReplaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2502,7 +2502,7 @@ const deserializeAws_json1_1ListRuleNamesByTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2546,7 +2546,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2590,7 +2590,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2634,7 +2634,7 @@ const deserializeAws_json1_1ListTargetsByRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2678,7 +2678,7 @@ const deserializeAws_json1_1PutEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2719,7 +2719,7 @@ const deserializeAws_json1_1PutPartnerEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2760,7 +2760,7 @@ const deserializeAws_json1_1PutPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2813,7 +2813,7 @@ const deserializeAws_json1_1PutRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2869,7 +2869,7 @@ const deserializeAws_json1_1PutTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2919,7 +2919,7 @@ const deserializeAws_json1_1RemovePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2969,7 +2969,7 @@ const deserializeAws_json1_1RemoveTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3019,7 +3019,7 @@ const deserializeAws_json1_1StartReplayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3072,7 +3072,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3122,7 +3122,7 @@ const deserializeAws_json1_1TestEventPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3166,7 +3166,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3216,7 +3216,7 @@ const deserializeAws_json1_1UpdateApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3266,7 +3266,7 @@ const deserializeAws_json1_1UpdateArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3319,7 +3319,7 @@ const deserializeAws_json1_1UpdateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6298,6 +6298,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts index 20e0e01806fd..0b368581d9f3 100644 --- a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts @@ -765,7 +765,7 @@ const deserializeAws_json1_1AssociateKmsKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -812,7 +812,7 @@ const deserializeAws_json1_1CancelExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -862,7 +862,7 @@ const deserializeAws_json1_1CreateExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -915,7 +915,7 @@ const deserializeAws_json1_1CreateLogGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -965,7 +965,7 @@ const deserializeAws_json1_1CreateLogStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1012,7 +1012,7 @@ const deserializeAws_json1_1DeleteDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_json1_1DeleteLogGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1106,7 +1106,7 @@ const deserializeAws_json1_1DeleteLogStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1153,7 +1153,7 @@ const deserializeAws_json1_1DeleteMetricFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1203,7 +1203,7 @@ const deserializeAws_json1_1DeleteQueryDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1247,7 +1247,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1291,7 +1291,7 @@ const deserializeAws_json1_1DeleteRetentionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1338,7 +1338,7 @@ const deserializeAws_json1_1DeleteSubscriptionFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1388,7 +1388,7 @@ const deserializeAws_json1_1DescribeDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1432,7 +1432,7 @@ const deserializeAws_json1_1DescribeExportTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1476,7 +1476,7 @@ const deserializeAws_json1_1DescribeLogGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1520,7 +1520,7 @@ const deserializeAws_json1_1DescribeLogStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1567,7 +1567,7 @@ const deserializeAws_json1_1DescribeMetricFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1614,7 +1614,7 @@ const deserializeAws_json1_1DescribeQueriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1661,7 +1661,7 @@ const deserializeAws_json1_1DescribeQueryDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_json1_1DescribeResourcePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1749,7 +1749,7 @@ const deserializeAws_json1_1DescribeSubscriptionFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_json1_1DisassociateKmsKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1843,7 +1843,7 @@ const deserializeAws_json1_1FilterLogEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1890,7 +1890,7 @@ const deserializeAws_json1_1GetLogEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1937,7 +1937,7 @@ const deserializeAws_json1_1GetLogGroupFieldsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1GetLogRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2037,7 +2037,7 @@ const deserializeAws_json1_1GetQueryResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2084,7 +2084,7 @@ const deserializeAws_json1_1ListTagsLogGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2128,7 +2128,7 @@ const deserializeAws_json1_1PutDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2172,7 +2172,7 @@ const deserializeAws_json1_1PutDestinationPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2219,7 +2219,7 @@ const deserializeAws_json1_1PutLogEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2272,7 +2272,7 @@ const deserializeAws_json1_1PutMetricFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2325,7 +2325,7 @@ const deserializeAws_json1_1PutQueryDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2375,7 +2375,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2419,7 +2419,7 @@ const deserializeAws_json1_1PutRetentionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2466,7 +2466,7 @@ const deserializeAws_json1_1PutSubscriptionFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2519,7 +2519,7 @@ const deserializeAws_json1_1StartQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2572,7 +2572,7 @@ const deserializeAws_json1_1StopQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2616,7 +2616,7 @@ const deserializeAws_json1_1TagLogGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2660,7 +2660,7 @@ const deserializeAws_json1_1TestMetricFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2701,7 +2701,7 @@ const deserializeAws_json1_1UntagLogGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4237,6 +4237,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cloudwatch/src/protocols/Aws_query.ts b/clients/client-cloudwatch/src/protocols/Aws_query.ts index 4222dd6e2486..65ce991a95ec 100644 --- a/clients/client-cloudwatch/src/protocols/Aws_query.ts +++ b/clients/client-cloudwatch/src/protocols/Aws_query.ts @@ -852,7 +852,7 @@ const deserializeAws_queryDeleteAlarmsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -893,7 +893,7 @@ const deserializeAws_queryDeleteAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -946,7 +946,7 @@ const deserializeAws_queryDeleteDashboardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -993,7 +993,7 @@ const deserializeAws_queryDeleteInsightRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1037,7 +1037,7 @@ const deserializeAws_queryDeleteMetricStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1084,7 +1084,7 @@ const deserializeAws_queryDescribeAlarmHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1125,7 +1125,7 @@ const deserializeAws_queryDescribeAlarmsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1166,7 +1166,7 @@ const deserializeAws_queryDescribeAlarmsForMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1201,7 +1201,7 @@ const deserializeAws_queryDescribeAnomalyDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1251,7 +1251,7 @@ const deserializeAws_queryDescribeInsightRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1289,7 +1289,7 @@ const deserializeAws_queryDisableAlarmActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1324,7 +1324,7 @@ const deserializeAws_queryDisableInsightRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1365,7 +1365,7 @@ const deserializeAws_queryEnableAlarmActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1400,7 +1400,7 @@ const deserializeAws_queryEnableInsightRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1447,7 +1447,7 @@ const deserializeAws_queryGetDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1494,7 +1494,7 @@ const deserializeAws_queryGetInsightRuleReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1541,7 +1541,7 @@ const deserializeAws_queryGetMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1582,7 +1582,7 @@ const deserializeAws_queryGetMetricStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1632,7 +1632,7 @@ const deserializeAws_queryGetMetricStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1685,7 +1685,7 @@ const deserializeAws_queryGetMetricWidgetImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1720,7 +1720,7 @@ const deserializeAws_queryListDashboardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1764,7 +1764,7 @@ const deserializeAws_queryListManagedInsightRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1811,7 +1811,7 @@ const deserializeAws_queryListMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1855,7 +1855,7 @@ const deserializeAws_queryListMetricStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1905,7 +1905,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1952,7 +1952,7 @@ const deserializeAws_queryPutAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2002,7 +2002,7 @@ const deserializeAws_queryPutCompositeAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2043,7 +2043,7 @@ const deserializeAws_queryPutDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2087,7 +2087,7 @@ const deserializeAws_queryPutInsightRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2134,7 +2134,7 @@ const deserializeAws_queryPutManagedInsightRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2175,7 +2175,7 @@ const deserializeAws_queryPutMetricAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2213,7 +2213,7 @@ const deserializeAws_queryPutMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2263,7 +2263,7 @@ const deserializeAws_queryPutMetricStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2313,7 +2313,7 @@ const deserializeAws_querySetAlarmStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2357,7 +2357,7 @@ const deserializeAws_queryStartMetricStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2404,7 +2404,7 @@ const deserializeAws_queryStopMetricStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2451,7 +2451,7 @@ const deserializeAws_queryTagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2501,7 +2501,7 @@ const deserializeAws_queryUntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6207,6 +6207,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-codeartifact/src/protocols/Aws_restJson1.ts b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts index 5da07f428194..8718da498f9a 100644 --- a/clients/client-codeartifact/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts @@ -1239,7 +1239,7 @@ const deserializeAws_restJson1AssociateExternalConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1304,7 +1304,7 @@ const deserializeAws_restJson1CopyPackageVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1363,7 +1363,7 @@ const deserializeAws_restJson1CreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1422,7 +1422,7 @@ const deserializeAws_restJson1CreateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1481,7 +1481,7 @@ const deserializeAws_restJson1DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1534,7 +1534,7 @@ const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1596,7 +1596,7 @@ const deserializeAws_restJson1DeletePackageVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1652,7 +1652,7 @@ const deserializeAws_restJson1DeleteRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1708,7 +1708,7 @@ const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1764,7 +1764,7 @@ const deserializeAws_restJson1DescribeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1817,7 +1817,7 @@ const deserializeAws_restJson1DescribePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1870,7 +1870,7 @@ const deserializeAws_restJson1DescribePackageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1926,7 +1926,7 @@ const deserializeAws_restJson1DescribeRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1979,7 +1979,7 @@ const deserializeAws_restJson1DisassociateExternalConnectionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2044,7 +2044,7 @@ const deserializeAws_restJson1DisposePackageVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2103,7 +2103,7 @@ const deserializeAws_restJson1GetAuthorizationTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2156,7 +2156,7 @@ const deserializeAws_restJson1GetDomainPermissionsPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2210,7 +2210,7 @@ const deserializeAws_restJson1GetPackageVersionAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2281,7 +2281,7 @@ const deserializeAws_restJson1GetPackageVersionReadmeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2334,7 +2334,7 @@ const deserializeAws_restJson1GetRepositoryEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2387,7 +2387,7 @@ const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2443,7 +2443,7 @@ const deserializeAws_restJson1ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2496,7 +2496,7 @@ const deserializeAws_restJson1ListPackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2567,7 +2567,7 @@ const deserializeAws_restJson1ListPackageVersionAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2638,7 +2638,7 @@ const deserializeAws_restJson1ListPackageVersionDependenciesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2706,7 +2706,7 @@ const deserializeAws_restJson1ListPackageVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2762,7 +2762,7 @@ const deserializeAws_restJson1ListRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2815,7 +2815,7 @@ const deserializeAws_restJson1ListRepositoriesInDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2868,7 +2868,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2918,7 +2918,7 @@ const deserializeAws_restJson1PutDomainPermissionsPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2980,7 +2980,7 @@ const deserializeAws_restJson1PutPackageOriginConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3033,7 +3033,7 @@ const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3089,7 +3089,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3139,7 +3139,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3195,7 +3195,7 @@ const deserializeAws_restJson1UpdatePackageVersionsStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3251,7 +3251,7 @@ const deserializeAws_restJson1UpdateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3937,6 +3937,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codebuild/src/protocols/Aws_json1_1.ts b/clients/client-codebuild/src/protocols/Aws_json1_1.ts index 2bc0aaabf793..2bf16a8e9dae 100644 --- a/clients/client-codebuild/src/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/src/protocols/Aws_json1_1.ts @@ -871,7 +871,7 @@ const deserializeAws_json1_1BatchDeleteBuildsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -912,7 +912,7 @@ const deserializeAws_json1_1BatchGetBuildBatchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -953,7 +953,7 @@ const deserializeAws_json1_1BatchGetBuildsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -994,7 +994,7 @@ const deserializeAws_json1_1BatchGetProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1035,7 +1035,7 @@ const deserializeAws_json1_1BatchGetReportGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1076,7 +1076,7 @@ const deserializeAws_json1_1BatchGetReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1117,7 +1117,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1164,7 +1164,7 @@ const deserializeAws_json1_1CreateReportGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1211,7 +1211,7 @@ const deserializeAws_json1_1CreateWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1261,7 +1261,7 @@ const deserializeAws_json1_1DeleteBuildBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1302,7 +1302,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1343,7 +1343,7 @@ const deserializeAws_json1_1DeleteReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1384,7 +1384,7 @@ const deserializeAws_json1_1DeleteReportGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1425,7 +1425,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1466,7 +1466,7 @@ const deserializeAws_json1_1DeleteSourceCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1510,7 +1510,7 @@ const deserializeAws_json1_1DeleteWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1557,7 +1557,7 @@ const deserializeAws_json1_1DescribeCodeCoveragesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1598,7 +1598,7 @@ const deserializeAws_json1_1DescribeTestCasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1642,7 +1642,7 @@ const deserializeAws_json1_1GetReportGroupTrendCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1686,7 +1686,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1730,7 +1730,7 @@ const deserializeAws_json1_1ImportSourceCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1777,7 +1777,7 @@ const deserializeAws_json1_1InvalidateProjectCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1821,7 +1821,7 @@ const deserializeAws_json1_1ListBuildBatchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1862,7 +1862,7 @@ const deserializeAws_json1_1ListBuildBatchesForProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1906,7 +1906,7 @@ const deserializeAws_json1_1ListBuildsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1947,7 +1947,7 @@ const deserializeAws_json1_1ListBuildsForProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1991,7 +1991,7 @@ const deserializeAws_json1_1ListCuratedEnvironmentImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2026,7 +2026,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2067,7 +2067,7 @@ const deserializeAws_json1_1ListReportGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2108,7 +2108,7 @@ const deserializeAws_json1_1ListReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2149,7 +2149,7 @@ const deserializeAws_json1_1ListReportsForReportGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2193,7 +2193,7 @@ const deserializeAws_json1_1ListSharedProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2234,7 +2234,7 @@ const deserializeAws_json1_1ListSharedReportGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_json1_1ListSourceCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2316,7 +2316,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2360,7 +2360,7 @@ const deserializeAws_json1_1RetryBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2407,7 +2407,7 @@ const deserializeAws_json1_1RetryBuildBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2451,7 +2451,7 @@ const deserializeAws_json1_1StartBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2498,7 +2498,7 @@ const deserializeAws_json1_1StartBuildBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2542,7 +2542,7 @@ const deserializeAws_json1_1StopBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2586,7 +2586,7 @@ const deserializeAws_json1_1StopBuildBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2630,7 +2630,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2674,7 +2674,7 @@ const deserializeAws_json1_1UpdateProjectVisibilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2718,7 +2718,7 @@ const deserializeAws_json1_1UpdateReportGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2762,7 +2762,7 @@ const deserializeAws_json1_1UpdateWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5484,6 +5484,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codecommit/src/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts index 48fdedb6ebc3..119f402c0c5c 100644 --- a/clients/client-codecommit/src/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/src/protocols/Aws_json1_1.ts @@ -1653,7 +1653,7 @@ const deserializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1730,7 +1730,7 @@ const deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesCo ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1798,7 +1798,7 @@ const deserializeAws_json1_1BatchDescribeMergeConflictsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1899,7 +1899,7 @@ const deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositorie ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1967,7 +1967,7 @@ const deserializeAws_json1_1BatchGetCommitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2035,7 +2035,7 @@ const deserializeAws_json1_1BatchGetRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2097,7 +2097,7 @@ const deserializeAws_json1_1CreateApprovalRuleTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2153,7 +2153,7 @@ const deserializeAws_json1_1CreateBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2233,7 +2233,7 @@ const deserializeAws_json1_1CreateCommitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2385,7 +2385,7 @@ const deserializeAws_json1_1CreatePullRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2498,7 +2498,7 @@ const deserializeAws_json1_1CreatePullRequestApprovalRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2581,7 +2581,7 @@ const deserializeAws_json1_1CreateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2661,7 +2661,7 @@ const deserializeAws_json1_1CreateUnreferencedMergeCommitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2810,7 +2810,7 @@ const deserializeAws_json1_1DeleteApprovalRuleTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2857,7 +2857,7 @@ const deserializeAws_json1_1DeleteBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2928,7 +2928,7 @@ const deserializeAws_json1_1DeleteCommentContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2978,7 +2978,7 @@ const deserializeAws_json1_1DeleteFileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3082,7 +3082,7 @@ const deserializeAws_json1_1DeletePullRequestApprovalRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_json1_1DeleteRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3215,7 +3215,7 @@ const deserializeAws_json1_1DescribeMergeConflictsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3322,7 +3322,7 @@ const deserializeAws_json1_1DescribePullRequestEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3396,7 +3396,7 @@ const deserializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3467,7 +3467,7 @@ const deserializeAws_json1_1EvaluatePullRequestApprovalRulesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3538,7 +3538,7 @@ const deserializeAws_json1_1GetApprovalRuleTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3585,7 +3585,7 @@ const deserializeAws_json1_1GetBlobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3659,7 +3659,7 @@ const deserializeAws_json1_1GetBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3730,7 +3730,7 @@ const deserializeAws_json1_1GetCommentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3795,7 +3795,7 @@ const deserializeAws_json1_1GetCommentReactionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3854,7 +3854,7 @@ const deserializeAws_json1_1GetCommentsForComparedCommitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3931,7 +3931,7 @@ const deserializeAws_json1_1GetCommentsForPullRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4020,7 +4020,7 @@ const deserializeAws_json1_1GetCommitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4091,7 +4091,7 @@ const deserializeAws_json1_1GetDifferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4177,7 +4177,7 @@ const deserializeAws_json1_1GetFileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4257,7 +4257,7 @@ const deserializeAws_json1_1GetFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4334,7 +4334,7 @@ const deserializeAws_json1_1GetMergeCommitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4411,7 +4411,7 @@ const deserializeAws_json1_1GetMergeConflictsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4515,7 +4515,7 @@ const deserializeAws_json1_1GetMergeOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4601,7 +4601,7 @@ const deserializeAws_json1_1GetPullRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4663,7 +4663,7 @@ const deserializeAws_json1_1GetPullRequestApprovalStatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4731,7 +4731,7 @@ const deserializeAws_json1_1GetPullRequestOverrideStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4799,7 +4799,7 @@ const deserializeAws_json1_1GetRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4861,7 +4861,7 @@ const deserializeAws_json1_1GetRepositoryTriggersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4923,7 +4923,7 @@ const deserializeAws_json1_1ListApprovalRuleTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4967,7 +4967,7 @@ const deserializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryComm ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5035,7 +5035,7 @@ const deserializeAws_json1_1ListBranchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5100,7 +5100,7 @@ const deserializeAws_json1_1ListPullRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5177,7 +5177,7 @@ const deserializeAws_json1_1ListRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5224,7 +5224,7 @@ const deserializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5292,7 +5292,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5342,7 +5342,7 @@ const deserializeAws_json1_1MergeBranchesByFastForwardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5437,7 +5437,7 @@ const deserializeAws_json1_1MergeBranchesBySquashCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5595,7 +5595,7 @@ const deserializeAws_json1_1MergeBranchesByThreeWayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5753,7 +5753,7 @@ const deserializeAws_json1_1MergePullRequestByFastForwardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5848,7 +5848,7 @@ const deserializeAws_json1_1MergePullRequestBySquashCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6003,7 +6003,7 @@ const deserializeAws_json1_1MergePullRequestByThreeWayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6155,7 +6155,7 @@ const deserializeAws_json1_1OverridePullRequestApprovalRulesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6238,7 +6238,7 @@ const deserializeAws_json1_1PostCommentForComparedCommitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6345,7 +6345,7 @@ const deserializeAws_json1_1PostCommentForPullRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6464,7 +6464,7 @@ const deserializeAws_json1_1PostCommentReplyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6523,7 +6523,7 @@ const deserializeAws_json1_1PutCommentReactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6582,7 +6582,7 @@ const deserializeAws_json1_1PutFileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6710,7 +6710,7 @@ const deserializeAws_json1_1PutRepositoryTriggersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6808,7 +6808,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6873,7 +6873,7 @@ const deserializeAws_json1_1TestRepositoryTriggersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6971,7 +6971,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7036,7 +7036,7 @@ const deserializeAws_json1_1UpdateApprovalRuleTemplateContentCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7092,7 +7092,7 @@ const deserializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7142,7 +7142,7 @@ const deserializeAws_json1_1UpdateApprovalRuleTemplateNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7192,7 +7192,7 @@ const deserializeAws_json1_1UpdateCommentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7248,7 +7248,7 @@ const deserializeAws_json1_1UpdateDefaultBranchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7319,7 +7319,7 @@ const deserializeAws_json1_1UpdatePullRequestApprovalRuleContentCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7402,7 +7402,7 @@ const deserializeAws_json1_1UpdatePullRequestApprovalStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7488,7 +7488,7 @@ const deserializeAws_json1_1UpdatePullRequestDescriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7541,7 +7541,7 @@ const deserializeAws_json1_1UpdatePullRequestStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7612,7 +7612,7 @@ const deserializeAws_json1_1UpdatePullRequestTitleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7665,7 +7665,7 @@ const deserializeAws_json1_1UpdateRepositoryDescriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7727,7 +7727,7 @@ const deserializeAws_json1_1UpdateRepositoryNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14673,6 +14673,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts index d9485f77d538..34c9b1de8e6d 100644 --- a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts @@ -1056,7 +1056,7 @@ const deserializeAws_json1_1AddTagsToOnPremisesInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1115,7 +1115,7 @@ const deserializeAws_json1_1BatchGetApplicationRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1171,7 +1171,7 @@ const deserializeAws_json1_1BatchGetApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1221,7 +1221,7 @@ const deserializeAws_json1_1BatchGetDeploymentGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1280,7 +1280,7 @@ const deserializeAws_json1_1BatchGetDeploymentInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1339,7 +1339,7 @@ const deserializeAws_json1_1BatchGetDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1386,7 +1386,7 @@ const deserializeAws_json1_1BatchGetDeploymentTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1451,7 +1451,7 @@ const deserializeAws_json1_1BatchGetOnPremisesInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1495,7 +1495,7 @@ const deserializeAws_json1_1ContinueDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1557,7 +1557,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1613,7 +1613,7 @@ const deserializeAws_json1_1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1726,7 +1726,7 @@ const deserializeAws_json1_1CreateDeploymentConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1785,7 +1785,7 @@ const deserializeAws_json1_1CreateDeploymentGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1919,7 +1919,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1963,7 +1963,7 @@ const deserializeAws_json1_1DeleteDeploymentConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2013,7 +2013,7 @@ const deserializeAws_json1_1DeleteDeploymentGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2066,7 +2066,7 @@ const deserializeAws_json1_1DeleteGitHubAccountTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2119,7 +2119,7 @@ const deserializeAws_json1_1DeleteResourcesByExternalIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2151,7 +2151,7 @@ const deserializeAws_json1_1DeregisterOnPremisesInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2195,7 +2195,7 @@ const deserializeAws_json1_1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2242,7 +2242,7 @@ const deserializeAws_json1_1GetApplicationRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2298,7 +2298,7 @@ const deserializeAws_json1_1GetDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2345,7 +2345,7 @@ const deserializeAws_json1_1GetDeploymentConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2395,7 +2395,7 @@ const deserializeAws_json1_1GetDeploymentGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2454,7 +2454,7 @@ const deserializeAws_json1_1GetDeploymentInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2513,7 +2513,7 @@ const deserializeAws_json1_1GetDeploymentTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2575,7 +2575,7 @@ const deserializeAws_json1_1GetOnPremisesInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2622,7 +2622,7 @@ const deserializeAws_json1_1ListApplicationRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2690,7 +2690,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2731,7 +2731,7 @@ const deserializeAws_json1_1ListDeploymentConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2772,7 +2772,7 @@ const deserializeAws_json1_1ListDeploymentGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2822,7 +2822,7 @@ const deserializeAws_json1_1ListDeploymentInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2890,7 +2890,7 @@ const deserializeAws_json1_1ListDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2961,7 +2961,7 @@ const deserializeAws_json1_1ListDeploymentTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3023,7 +3023,7 @@ const deserializeAws_json1_1ListGitHubAccountTokenNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3070,7 +3070,7 @@ const deserializeAws_json1_1ListOnPremisesInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3117,7 +3117,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3164,7 +3164,7 @@ const deserializeAws_json1_1PutLifecycleEventHookExecutionStatusCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3223,7 +3223,7 @@ const deserializeAws_json1_1RegisterApplicationRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3276,7 +3276,7 @@ const deserializeAws_json1_1RegisterOnPremisesInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3341,7 +3341,7 @@ const deserializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3397,7 +3397,7 @@ const deserializeAws_json1_1SkipWaitTimeForInstanceTerminationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3453,7 +3453,7 @@ const deserializeAws_json1_1StopDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3509,7 +3509,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3571,7 +3571,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3630,7 +3630,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3680,7 +3680,7 @@ const deserializeAws_json1_1UpdateDeploymentGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8790,6 +8790,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts index 22544396ef77..7dddaa6ae1bd 100644 --- a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts @@ -533,7 +533,7 @@ const deserializeAws_restJson1AssociateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -586,7 +586,7 @@ const deserializeAws_restJson1CreateCodeReviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -642,7 +642,7 @@ const deserializeAws_restJson1DescribeCodeReviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -698,7 +698,7 @@ const deserializeAws_restJson1DescribeRecommendationFeedbackCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -754,7 +754,7 @@ const deserializeAws_restJson1DescribeRepositoryAssociationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -810,7 +810,7 @@ const deserializeAws_restJson1DisassociateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -869,7 +869,7 @@ const deserializeAws_restJson1ListCodeReviewsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_restJson1ListRecommendationFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -984,7 +984,7 @@ const deserializeAws_restJson1ListRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1043,7 +1043,7 @@ const deserializeAws_restJson1ListRepositoryAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1090,7 +1090,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1134,7 +1134,7 @@ const deserializeAws_restJson1PutRecommendationFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1184,7 +1184,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1228,7 +1228,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1968,6 +1968,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts index b58c1621eb2b..6ab2a184f3ce 100644 --- a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts @@ -896,7 +896,7 @@ const deserializeAws_restJson1AddNotificationChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -967,7 +967,7 @@ const deserializeAws_restJson1BatchGetFrameMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1015,7 +1015,7 @@ const deserializeAws_restJson1ConfigureAgentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1063,7 +1063,7 @@ const deserializeAws_restJson1CreateProfilingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1113,7 +1113,7 @@ const deserializeAws_restJson1DeleteProfilingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1164,7 +1164,7 @@ const deserializeAws_restJson1DescribeProfilingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1217,7 +1217,7 @@ const deserializeAws_restJson1GetFindingsReportAccountSummaryCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1267,7 +1267,7 @@ const deserializeAws_restJson1GetNotificationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1320,7 +1320,7 @@ const deserializeAws_restJson1GetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1367,7 +1367,7 @@ const deserializeAws_restJson1GetProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1429,7 +1429,7 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1485,7 +1485,7 @@ const deserializeAws_restJson1ListFindingsReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_restJson1ListProfileTimesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1594,7 +1594,7 @@ const deserializeAws_restJson1ListProfilingGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1638,7 +1638,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1682,7 +1682,7 @@ const deserializeAws_restJson1PostAgentProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1735,7 +1735,7 @@ const deserializeAws_restJson1PutPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1791,7 +1791,7 @@ const deserializeAws_restJson1RemoveNotificationChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1844,7 +1844,7 @@ const deserializeAws_restJson1RemovePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1894,7 +1894,7 @@ const deserializeAws_restJson1SubmitFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1941,7 +1941,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1985,7 +1985,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_restJson1UpdateProfilingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2732,6 +2732,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts index 6782b48c62ca..6f5375ec33c6 100644 --- a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts @@ -824,7 +824,7 @@ const deserializeAws_json1_1AcknowledgeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -871,7 +871,7 @@ const deserializeAws_json1_1AcknowledgeThirdPartyJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -921,7 +921,7 @@ const deserializeAws_json1_1CreateCustomActionTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -974,7 +974,7 @@ const deserializeAws_json1_1CreatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1039,7 +1039,7 @@ const deserializeAws_json1_1DeleteCustomActionTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1080,7 +1080,7 @@ const deserializeAws_json1_1DeletePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1124,7 +1124,7 @@ const deserializeAws_json1_1DeleteWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1168,7 +1168,7 @@ const deserializeAws_json1_1DeregisterWebhookWithThirdPartyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1209,7 +1209,7 @@ const deserializeAws_json1_1DisableStageTransitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1253,7 +1253,7 @@ const deserializeAws_json1_1EnableStageTransitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1300,7 +1300,7 @@ const deserializeAws_json1_1GetActionTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1344,7 +1344,7 @@ const deserializeAws_json1_1GetJobDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1388,7 +1388,7 @@ const deserializeAws_json1_1GetPipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1435,7 +1435,7 @@ const deserializeAws_json1_1GetPipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1482,7 +1482,7 @@ const deserializeAws_json1_1GetPipelineStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1526,7 +1526,7 @@ const deserializeAws_json1_1GetThirdPartyJobDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1576,7 +1576,7 @@ const deserializeAws_json1_1ListActionExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1626,7 +1626,7 @@ const deserializeAws_json1_1ListActionTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1670,7 +1670,7 @@ const deserializeAws_json1_1ListPipelineExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1717,7 +1717,7 @@ const deserializeAws_json1_1ListPipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1761,7 +1761,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1811,7 +1811,7 @@ const deserializeAws_json1_1ListWebhooksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1855,7 +1855,7 @@ const deserializeAws_json1_1PollForJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1899,7 +1899,7 @@ const deserializeAws_json1_1PollForThirdPartyJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1943,7 +1943,7 @@ const deserializeAws_json1_1PutActionRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1993,7 +1993,7 @@ const deserializeAws_json1_1PutApprovalResultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2046,7 +2046,7 @@ const deserializeAws_json1_1PutJobFailureResultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2090,7 +2090,7 @@ const deserializeAws_json1_1PutJobSuccessResultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2137,7 +2137,7 @@ const deserializeAws_json1_1PutThirdPartyJobFailureResultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2184,7 +2184,7 @@ const deserializeAws_json1_1PutThirdPartyJobSuccessResultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2234,7 +2234,7 @@ const deserializeAws_json1_1PutWebhookCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2296,7 +2296,7 @@ const deserializeAws_json1_1RegisterWebhookWithThirdPartyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2340,7 +2340,7 @@ const deserializeAws_json1_1RetryStageExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2396,7 +2396,7 @@ const deserializeAws_json1_1StartPipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2443,7 +2443,7 @@ const deserializeAws_json1_1StopPipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2496,7 +2496,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2552,7 +2552,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2602,7 +2602,7 @@ const deserializeAws_json1_1UpdateActionTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2649,7 +2649,7 @@ const deserializeAws_json1_1UpdatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5705,6 +5705,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts index 25588d46b24c..4f9d35b4063b 100644 --- a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts @@ -243,7 +243,7 @@ const deserializeAws_json1_0CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -290,7 +290,7 @@ const deserializeAws_json1_0CreateHostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -331,7 +331,7 @@ const deserializeAws_json1_0DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -372,7 +372,7 @@ const deserializeAws_json1_0DeleteHostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -416,7 +416,7 @@ const deserializeAws_json1_0GetConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -460,7 +460,7 @@ const deserializeAws_json1_0GetHostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -504,7 +504,7 @@ const deserializeAws_json1_0ListConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -539,7 +539,7 @@ const deserializeAws_json1_0ListHostsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -574,7 +574,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -615,7 +615,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -659,7 +659,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -700,7 +700,7 @@ const deserializeAws_json1_0UpdateHostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1209,6 +1209,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts index 2fd5ad481313..a182fef92e7b 100644 --- a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts +++ b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts @@ -437,7 +437,7 @@ const deserializeAws_restJson1CreateNotificationRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -493,7 +493,7 @@ const deserializeAws_restJson1DeleteNotificationRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -537,7 +537,7 @@ const deserializeAws_restJson1DeleteTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -608,7 +608,7 @@ const deserializeAws_restJson1DescribeNotificationRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -655,7 +655,7 @@ const deserializeAws_restJson1ListEventTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -702,7 +702,7 @@ const deserializeAws_restJson1ListNotificationRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -746,7 +746,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -793,7 +793,7 @@ const deserializeAws_restJson1ListTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -837,7 +837,7 @@ const deserializeAws_restJson1SubscribeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -884,7 +884,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_restJson1UnsubscribeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -972,7 +972,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1019,7 +1019,7 @@ const deserializeAws_restJson1UpdateNotificationRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1370,6 +1370,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-codestar/src/protocols/Aws_json1_1.ts b/clients/client-codestar/src/protocols/Aws_json1_1.ts index 648e0fe71091..b436ae1e9a80 100644 --- a/clients/client-codestar/src/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/src/protocols/Aws_json1_1.ts @@ -366,7 +366,7 @@ const deserializeAws_json1_1AssociateTeamMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -425,7 +425,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -484,7 +484,7 @@ const deserializeAws_json1_1CreateUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -528,7 +528,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -575,7 +575,7 @@ const deserializeAws_json1_1DeleteUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -616,7 +616,7 @@ const deserializeAws_json1_1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -669,7 +669,7 @@ const deserializeAws_json1_1DescribeUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -713,7 +713,7 @@ const deserializeAws_json1_1DisassociateTeamMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -763,7 +763,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -807,7 +807,7 @@ const deserializeAws_json1_1ListResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -854,7 +854,7 @@ const deserializeAws_json1_1ListTagsForProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -901,7 +901,7 @@ const deserializeAws_json1_1ListTeamMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -948,7 +948,7 @@ const deserializeAws_json1_1ListUserProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -992,7 +992,7 @@ const deserializeAws_json1_1TagProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1042,7 +1042,7 @@ const deserializeAws_json1_1UntagProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1092,7 +1092,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1136,7 +1136,7 @@ const deserializeAws_json1_1UpdateTeamMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1195,7 +1195,7 @@ const deserializeAws_json1_1UpdateUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2094,6 +2094,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts index 44f17f5d4949..824af516c451 100644 --- a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts @@ -1933,7 +1933,7 @@ const deserializeAws_json1_1AddCustomAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1986,7 +1986,7 @@ const deserializeAws_json1_1AdminAddUserToGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2042,7 +2042,7 @@ const deserializeAws_json1_1AdminConfirmSignUpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2113,7 +2113,7 @@ const deserializeAws_json1_1AdminCreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2196,7 +2196,7 @@ const deserializeAws_json1_1AdminDeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2252,7 +2252,7 @@ const deserializeAws_json1_1AdminDeleteUserAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2308,7 +2308,7 @@ const deserializeAws_json1_1AdminDisableProviderForUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2367,7 +2367,7 @@ const deserializeAws_json1_1AdminDisableUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2423,7 +2423,7 @@ const deserializeAws_json1_1AdminEnableUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2476,7 +2476,7 @@ const deserializeAws_json1_1AdminForgetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2535,7 +2535,7 @@ const deserializeAws_json1_1AdminGetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2591,7 +2591,7 @@ const deserializeAws_json1_1AdminGetUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2647,7 +2647,7 @@ const deserializeAws_json1_1AdminInitiateAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2730,7 +2730,7 @@ const deserializeAws_json1_1AdminLinkProviderForUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2792,7 +2792,7 @@ const deserializeAws_json1_1AdminListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2848,7 +2848,7 @@ const deserializeAws_json1_1AdminListGroupsForUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2904,7 +2904,7 @@ const deserializeAws_json1_1AdminListUserAuthEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2960,7 +2960,7 @@ const deserializeAws_json1_1AdminRemoveUserFromGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3016,7 +3016,7 @@ const deserializeAws_json1_1AdminResetUserPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3093,7 +3093,7 @@ const deserializeAws_json1_1AdminRespondToAuthChallengeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3191,7 +3191,7 @@ const deserializeAws_json1_1AdminSetUserMFAPreferenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3250,7 +3250,7 @@ const deserializeAws_json1_1AdminSetUserPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3309,7 +3309,7 @@ const deserializeAws_json1_1AdminSetUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3362,7 +3362,7 @@ const deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3421,7 +3421,7 @@ const deserializeAws_json1_1AdminUpdateDeviceStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3480,7 +3480,7 @@ const deserializeAws_json1_1AdminUpdateUserAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3557,7 +3557,7 @@ const deserializeAws_json1_1AdminUserGlobalSignOutCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3613,7 +3613,7 @@ const deserializeAws_json1_1AssociateSoftwareTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3672,7 +3672,7 @@ const deserializeAws_json1_1ChangePasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3743,7 +3743,7 @@ const deserializeAws_json1_1ConfirmDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3820,7 +3820,7 @@ const deserializeAws_json1_1ConfirmForgotPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3906,7 +3906,7 @@ const deserializeAws_json1_1ConfirmSignUpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3989,7 +3989,7 @@ const deserializeAws_json1_1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4048,7 +4048,7 @@ const deserializeAws_json1_1CreateIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4107,7 +4107,7 @@ const deserializeAws_json1_1CreateResourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4163,7 +4163,7 @@ const deserializeAws_json1_1CreateUserImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4222,7 +4222,7 @@ const deserializeAws_json1_1CreateUserPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4287,7 +4287,7 @@ const deserializeAws_json1_1CreateUserPoolClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4349,7 +4349,7 @@ const deserializeAws_json1_1CreateUserPoolDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4399,7 +4399,7 @@ const deserializeAws_json1_1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4449,7 +4449,7 @@ const deserializeAws_json1_1DeleteIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4502,7 +4502,7 @@ const deserializeAws_json1_1DeleteResourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4552,7 +4552,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4617,7 +4617,7 @@ const deserializeAws_json1_1DeleteUserAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4679,7 +4679,7 @@ const deserializeAws_json1_1DeleteUserPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4732,7 +4732,7 @@ const deserializeAws_json1_1DeleteUserPoolClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4785,7 +4785,7 @@ const deserializeAws_json1_1DeleteUserPoolDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4835,7 +4835,7 @@ const deserializeAws_json1_1DescribeIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4888,7 +4888,7 @@ const deserializeAws_json1_1DescribeResourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4941,7 +4941,7 @@ const deserializeAws_json1_1DescribeRiskConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4997,7 +4997,7 @@ const deserializeAws_json1_1DescribeUserImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5050,7 +5050,7 @@ const deserializeAws_json1_1DescribeUserPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5106,7 +5106,7 @@ const deserializeAws_json1_1DescribeUserPoolClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5159,7 +5159,7 @@ const deserializeAws_json1_1DescribeUserPoolDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5206,7 +5206,7 @@ const deserializeAws_json1_1ForgetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5274,7 +5274,7 @@ const deserializeAws_json1_1ForgotPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5357,7 +5357,7 @@ const deserializeAws_json1_1GetCSVHeaderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5410,7 +5410,7 @@ const deserializeAws_json1_1GetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5478,7 +5478,7 @@ const deserializeAws_json1_1GetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5531,7 +5531,7 @@ const deserializeAws_json1_1GetIdentityProviderByIdentifierCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5584,7 +5584,7 @@ const deserializeAws_json1_1GetSigningCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5631,7 +5631,7 @@ const deserializeAws_json1_1GetUICustomizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5684,7 +5684,7 @@ const deserializeAws_json1_1GetUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5749,7 +5749,7 @@ const deserializeAws_json1_1GetUserAttributeVerificationCodeCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5838,7 +5838,7 @@ const deserializeAws_json1_1GetUserPoolMfaConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5891,7 +5891,7 @@ const deserializeAws_json1_1GlobalSignOutCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5953,7 +5953,7 @@ const deserializeAws_json1_1InitiateAuthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6036,7 +6036,7 @@ const deserializeAws_json1_1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6104,7 +6104,7 @@ const deserializeAws_json1_1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6157,7 +6157,7 @@ const deserializeAws_json1_1ListIdentityProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6210,7 +6210,7 @@ const deserializeAws_json1_1ListResourceServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6263,7 +6263,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6316,7 +6316,7 @@ const deserializeAws_json1_1ListUserImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6369,7 +6369,7 @@ const deserializeAws_json1_1ListUserPoolClientsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6422,7 +6422,7 @@ const deserializeAws_json1_1ListUserPoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6472,7 +6472,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6525,7 +6525,7 @@ const deserializeAws_json1_1ListUsersInGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6578,7 +6578,7 @@ const deserializeAws_json1_1ResendConfirmationCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6661,7 +6661,7 @@ const deserializeAws_json1_1RespondToAuthChallengeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6762,7 +6762,7 @@ const deserializeAws_json1_1RevokeTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6821,7 +6821,7 @@ const deserializeAws_json1_1SetRiskConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6883,7 +6883,7 @@ const deserializeAws_json1_1SetUICustomizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6936,7 +6936,7 @@ const deserializeAws_json1_1SetUserMFAPreferenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6998,7 +6998,7 @@ const deserializeAws_json1_1SetUserPoolMfaConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7057,7 +7057,7 @@ const deserializeAws_json1_1SetUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7119,7 +7119,7 @@ const deserializeAws_json1_1SignUpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7202,7 +7202,7 @@ const deserializeAws_json1_1StartUserImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7258,7 +7258,7 @@ const deserializeAws_json1_1StopUserImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7314,7 +7314,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7367,7 +7367,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7420,7 +7420,7 @@ const deserializeAws_json1_1UpdateAuthEventFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7479,7 +7479,7 @@ const deserializeAws_json1_1UpdateDeviceStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7547,7 +7547,7 @@ const deserializeAws_json1_1UpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7600,7 +7600,7 @@ const deserializeAws_json1_1UpdateIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7656,7 +7656,7 @@ const deserializeAws_json1_1UpdateResourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7709,7 +7709,7 @@ const deserializeAws_json1_1UpdateUserAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7804,7 +7804,7 @@ const deserializeAws_json1_1UpdateUserPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7875,7 +7875,7 @@ const deserializeAws_json1_1UpdateUserPoolClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7937,7 +7937,7 @@ const deserializeAws_json1_1UpdateUserPoolDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7990,7 +7990,7 @@ const deserializeAws_json1_1VerifySoftwareTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8067,7 +8067,7 @@ const deserializeAws_json1_1VerifyUserAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13351,6 +13351,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts index df63f4bd6b91..d4f3c5351a4f 100644 --- a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts @@ -455,7 +455,7 @@ const deserializeAws_json1_1CreateIdentityPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -511,7 +511,7 @@ const deserializeAws_json1_1DeleteIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -555,7 +555,7 @@ const deserializeAws_json1_1DeleteIdentityPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -608,7 +608,7 @@ const deserializeAws_json1_1DescribeIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -661,7 +661,7 @@ const deserializeAws_json1_1DescribeIdentityPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -714,7 +714,7 @@ const deserializeAws_json1_1GetCredentialsForIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -776,7 +776,7 @@ const deserializeAws_json1_1GetIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -838,7 +838,7 @@ const deserializeAws_json1_1GetIdentityPoolRolesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -894,7 +894,7 @@ const deserializeAws_json1_1GetOpenIdTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -953,7 +953,7 @@ const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1012,7 +1012,7 @@ const deserializeAws_json1_1GetPrincipalTagAttributeMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1065,7 +1065,7 @@ const deserializeAws_json1_1ListIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1118,7 +1118,7 @@ const deserializeAws_json1_1ListIdentityPoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1171,7 +1171,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1224,7 +1224,7 @@ const deserializeAws_json1_1LookupDeveloperIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1280,7 +1280,7 @@ const deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1333,7 +1333,7 @@ const deserializeAws_json1_1SetIdentityPoolRolesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1392,7 +1392,7 @@ const deserializeAws_json1_1SetPrincipalTagAttributeMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1445,7 +1445,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1495,7 +1495,7 @@ const deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1548,7 +1548,7 @@ const deserializeAws_json1_1UnlinkIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1607,7 +1607,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1660,7 +1660,7 @@ const deserializeAws_json1_1UpdateIdentityPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2839,6 +2839,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts index 51ff70ae6736..e2c4bd05b346 100644 --- a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts +++ b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts @@ -649,7 +649,7 @@ const deserializeAws_restJson1BulkPublishCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -705,7 +705,7 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -761,7 +761,7 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -814,7 +814,7 @@ const deserializeAws_restJson1DescribeIdentityPoolUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -867,7 +867,7 @@ const deserializeAws_restJson1DescribeIdentityUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_restJson1GetBulkPublishDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -984,7 +984,7 @@ const deserializeAws_restJson1GetCognitoEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1043,7 +1043,7 @@ const deserializeAws_restJson1GetIdentityPoolConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1102,7 +1102,7 @@ const deserializeAws_restJson1ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1161,7 +1161,7 @@ const deserializeAws_restJson1ListIdentityPoolUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1235,7 +1235,7 @@ const deserializeAws_restJson1ListRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1285,7 +1285,7 @@ const deserializeAws_restJson1RegisterDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1338,7 +1338,7 @@ const deserializeAws_restJson1SetCognitoEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1397,7 +1397,7 @@ const deserializeAws_restJson1SetIdentityPoolConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1450,7 +1450,7 @@ const deserializeAws_restJson1SubscribeToDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1503,7 +1503,7 @@ const deserializeAws_restJson1UnsubscribeFromDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1559,7 +1559,7 @@ const deserializeAws_restJson1UpdateRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2051,6 +2051,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-comprehend/src/protocols/Aws_json1_1.ts b/clients/client-comprehend/src/protocols/Aws_json1_1.ts index aff861a6c862..921280c65a41 100644 --- a/clients/client-comprehend/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/src/protocols/Aws_json1_1.ts @@ -1470,7 +1470,7 @@ const deserializeAws_json1_1BatchDetectDominantLanguageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1520,7 +1520,7 @@ const deserializeAws_json1_1BatchDetectEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1573,7 +1573,7 @@ const deserializeAws_json1_1BatchDetectKeyPhrasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1626,7 +1626,7 @@ const deserializeAws_json1_1BatchDetectSentimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1679,7 +1679,7 @@ const deserializeAws_json1_1BatchDetectSyntaxCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1732,7 +1732,7 @@ const deserializeAws_json1_1BatchDetectTargetedSentimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1785,7 +1785,7 @@ const deserializeAws_json1_1ClassifyDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1835,7 +1835,7 @@ const deserializeAws_json1_1ContainsPiiEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1885,7 +1885,7 @@ const deserializeAws_json1_1CreateDocumentClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1947,7 +1947,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2009,7 +2009,7 @@ const deserializeAws_json1_1CreateEntityRecognizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2071,7 +2071,7 @@ const deserializeAws_json1_1DeleteDocumentClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2127,7 +2127,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2180,7 +2180,7 @@ const deserializeAws_json1_1DeleteEntityRecognizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2236,7 +2236,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2283,7 +2283,7 @@ const deserializeAws_json1_1DescribeDocumentClassificationJobCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2333,7 +2333,7 @@ const deserializeAws_json1_1DescribeDocumentClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2383,7 +2383,7 @@ const deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2433,7 +2433,7 @@ const deserializeAws_json1_1DescribeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2483,7 +2483,7 @@ const deserializeAws_json1_1DescribeEntitiesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2533,7 +2533,7 @@ const deserializeAws_json1_1DescribeEntityRecognizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2583,7 +2583,7 @@ const deserializeAws_json1_1DescribeEventsDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2633,7 +2633,7 @@ const deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2683,7 +2683,7 @@ const deserializeAws_json1_1DescribePiiEntitiesDetectionJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2733,7 +2733,7 @@ const deserializeAws_json1_1DescribeResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2780,7 +2780,7 @@ const deserializeAws_json1_1DescribeSentimentDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2830,7 +2830,7 @@ const deserializeAws_json1_1DescribeTargetedSentimentDetectionJobCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2880,7 +2880,7 @@ const deserializeAws_json1_1DescribeTopicsDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2930,7 +2930,7 @@ const deserializeAws_json1_1DetectDominantLanguageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2977,7 +2977,7 @@ const deserializeAws_json1_1DetectEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3030,7 +3030,7 @@ const deserializeAws_json1_1DetectKeyPhrasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3080,7 +3080,7 @@ const deserializeAws_json1_1DetectPiiEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3130,7 +3130,7 @@ const deserializeAws_json1_1DetectSentimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3180,7 +3180,7 @@ const deserializeAws_json1_1DetectSyntaxCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3230,7 +3230,7 @@ const deserializeAws_json1_1DetectTargetedSentimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3280,7 +3280,7 @@ const deserializeAws_json1_1ImportModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3345,7 +3345,7 @@ const deserializeAws_json1_1ListDocumentClassificationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3395,7 +3395,7 @@ const deserializeAws_json1_1ListDocumentClassifiersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3445,7 +3445,7 @@ const deserializeAws_json1_1ListDocumentClassifierSummariesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3492,7 +3492,7 @@ const deserializeAws_json1_1ListDominantLanguageDetectionJobsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3542,7 +3542,7 @@ const deserializeAws_json1_1ListEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3589,7 +3589,7 @@ const deserializeAws_json1_1ListEntitiesDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3639,7 +3639,7 @@ const deserializeAws_json1_1ListEntityRecognizersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3689,7 +3689,7 @@ const deserializeAws_json1_1ListEntityRecognizerSummariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3736,7 +3736,7 @@ const deserializeAws_json1_1ListEventsDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,7 +3786,7 @@ const deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3836,7 +3836,7 @@ const deserializeAws_json1_1ListPiiEntitiesDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3886,7 +3886,7 @@ const deserializeAws_json1_1ListSentimentDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3936,7 +3936,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3983,7 +3983,7 @@ const deserializeAws_json1_1ListTargetedSentimentDetectionJobsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4033,7 +4033,7 @@ const deserializeAws_json1_1ListTopicsDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4083,7 +4083,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4130,7 +4130,7 @@ const deserializeAws_json1_1StartDocumentClassificationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4189,7 +4189,7 @@ const deserializeAws_json1_1StartDominantLanguageDetectionJobCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4242,7 +4242,7 @@ const deserializeAws_json1_1StartEntitiesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4301,7 +4301,7 @@ const deserializeAws_json1_1StartEventsDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4354,7 +4354,7 @@ const deserializeAws_json1_1StartKeyPhrasesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4407,7 +4407,7 @@ const deserializeAws_json1_1StartPiiEntitiesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4460,7 +4460,7 @@ const deserializeAws_json1_1StartSentimentDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4513,7 +4513,7 @@ const deserializeAws_json1_1StartTargetedSentimentDetectionJobCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4566,7 +4566,7 @@ const deserializeAws_json1_1StartTopicsDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4619,7 +4619,7 @@ const deserializeAws_json1_1StopDominantLanguageDetectionJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4666,7 +4666,7 @@ const deserializeAws_json1_1StopEntitiesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4713,7 +4713,7 @@ const deserializeAws_json1_1StopEventsDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4760,7 +4760,7 @@ const deserializeAws_json1_1StopKeyPhrasesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4807,7 +4807,7 @@ const deserializeAws_json1_1StopPiiEntitiesDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4854,7 +4854,7 @@ const deserializeAws_json1_1StopSentimentDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4901,7 +4901,7 @@ const deserializeAws_json1_1StopTargetedSentimentDetectionJobCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4948,7 +4948,7 @@ const deserializeAws_json1_1StopTrainingDocumentClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4998,7 +4998,7 @@ const deserializeAws_json1_1StopTrainingEntityRecognizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5048,7 +5048,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5101,7 +5101,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5154,7 +5154,7 @@ const deserializeAws_json1_1UpdateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9040,6 +9040,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts index a09129b0c0e4..030c32e5a720 100644 --- a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts @@ -551,7 +551,7 @@ const deserializeAws_json1_1DescribeEntitiesDetectionV2JobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -601,7 +601,7 @@ const deserializeAws_json1_1DescribeICD10CMInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -651,7 +651,7 @@ const deserializeAws_json1_1DescribePHIDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -701,7 +701,7 @@ const deserializeAws_json1_1DescribeRxNormInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -751,7 +751,7 @@ const deserializeAws_json1_1DescribeSNOMEDCTInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -801,7 +801,7 @@ const deserializeAws_json1_1DetectEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -857,7 +857,7 @@ const deserializeAws_json1_1DetectEntitiesV2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -913,7 +913,7 @@ const deserializeAws_json1_1DetectPHICommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -969,7 +969,7 @@ const deserializeAws_json1_1InferICD10CMCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1025,7 +1025,7 @@ const deserializeAws_json1_1InferRxNormCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1081,7 +1081,7 @@ const deserializeAws_json1_1InferSNOMEDCTCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_json1_1ListEntitiesDetectionV2JobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1187,7 +1187,7 @@ const deserializeAws_json1_1ListICD10CMInferenceJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1237,7 +1237,7 @@ const deserializeAws_json1_1ListPHIDetectionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1287,7 +1287,7 @@ const deserializeAws_json1_1ListRxNormInferenceJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1337,7 +1337,7 @@ const deserializeAws_json1_1ListSNOMEDCTInferenceJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1387,7 +1387,7 @@ const deserializeAws_json1_1StartEntitiesDetectionV2JobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1437,7 +1437,7 @@ const deserializeAws_json1_1StartICD10CMInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1487,7 +1487,7 @@ const deserializeAws_json1_1StartPHIDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1537,7 +1537,7 @@ const deserializeAws_json1_1StartRxNormInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1587,7 +1587,7 @@ const deserializeAws_json1_1StartSNOMEDCTInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1637,7 +1637,7 @@ const deserializeAws_json1_1StopEntitiesDetectionV2JobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1684,7 +1684,7 @@ const deserializeAws_json1_1StopICD10CMInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1731,7 +1731,7 @@ const deserializeAws_json1_1StopPHIDetectionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1778,7 +1778,7 @@ const deserializeAws_json1_1StopRxNormInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1825,7 +1825,7 @@ const deserializeAws_json1_1StopSNOMEDCTInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3133,6 +3133,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts index 6e1915281f1a..875ec075fe10 100644 --- a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts @@ -445,7 +445,7 @@ const deserializeAws_json1_0DeleteRecommendationPreferencesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -507,7 +507,7 @@ const deserializeAws_json1_0DescribeRecommendationExportJobsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -569,7 +569,7 @@ const deserializeAws_json1_0ExportAutoScalingGroupRecommendationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -631,7 +631,7 @@ const deserializeAws_json1_0ExportEBSVolumeRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -693,7 +693,7 @@ const deserializeAws_json1_0ExportEC2InstanceRecommendationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -755,7 +755,7 @@ const deserializeAws_json1_0ExportLambdaFunctionRecommendationsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -817,7 +817,7 @@ const deserializeAws_json1_0GetAutoScalingGroupRecommendationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -879,7 +879,7 @@ const deserializeAws_json1_0GetEBSVolumeRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -941,7 +941,7 @@ const deserializeAws_json1_0GetEC2InstanceRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1003,7 +1003,7 @@ const deserializeAws_json1_0GetEC2RecommendationProjectedMetricsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1065,7 +1065,7 @@ const deserializeAws_json1_0GetEffectiveRecommendationPreferencesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1127,7 +1127,7 @@ const deserializeAws_json1_0GetEnrollmentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1183,7 +1183,7 @@ const deserializeAws_json1_0GetEnrollmentStatusesForOrganizationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1239,7 +1239,7 @@ const deserializeAws_json1_0GetLambdaFunctionRecommendationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1301,7 +1301,7 @@ const deserializeAws_json1_0GetRecommendationPreferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1363,7 +1363,7 @@ const deserializeAws_json1_0GetRecommendationSummariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1422,7 +1422,7 @@ const deserializeAws_json1_0PutRecommendationPreferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1484,7 +1484,7 @@ const deserializeAws_json1_0UpdateEnrollmentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3363,6 +3363,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-config-service/src/protocols/Aws_json1_1.ts b/clients/client-config-service/src/protocols/Aws_json1_1.ts index 162eb0b5effa..7966ddf1da5f 100644 --- a/clients/client-config-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/src/protocols/Aws_json1_1.ts @@ -1833,7 +1833,7 @@ const deserializeAws_json1_1BatchGetAggregateResourceConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1877,7 +1877,7 @@ const deserializeAws_json1_1BatchGetResourceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1918,7 +1918,7 @@ const deserializeAws_json1_1DeleteAggregationAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1956,7 +1956,7 @@ const deserializeAws_json1_1DeleteConfigRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1997,7 +1997,7 @@ const deserializeAws_json1_1DeleteConfigurationAggregatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2035,7 +2035,7 @@ const deserializeAws_json1_1DeleteConfigurationRecorderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2073,7 +2073,7 @@ const deserializeAws_json1_1DeleteConformancePackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2114,7 +2114,7 @@ const deserializeAws_json1_1DeleteDeliveryChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2158,7 +2158,7 @@ const deserializeAws_json1_1DeleteEvaluationResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2199,7 +2199,7 @@ const deserializeAws_json1_1DeleteOrganizationConfigRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2243,7 +2243,7 @@ const deserializeAws_json1_1DeleteOrganizationConformancePackCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2287,7 +2287,7 @@ const deserializeAws_json1_1DeletePendingAggregationRequestCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2328,7 +2328,7 @@ const deserializeAws_json1_1DeleteRemediationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2378,7 +2378,7 @@ const deserializeAws_json1_1DeleteRemediationExceptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2416,7 +2416,7 @@ const deserializeAws_json1_1DeleteResourceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2457,7 +2457,7 @@ const deserializeAws_json1_1DeleteRetentionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2501,7 +2501,7 @@ const deserializeAws_json1_1DeleteStoredQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2545,7 +2545,7 @@ const deserializeAws_json1_1DeliverConfigSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2592,7 +2592,7 @@ const deserializeAws_json1_1DescribeAggregateComplianceByConfigRulesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2642,7 +2642,7 @@ const deserializeAws_json1_1DescribeAggregateComplianceByConformancePacksCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2692,7 +2692,7 @@ const deserializeAws_json1_1DescribeAggregationAuthorizationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2739,7 +2739,7 @@ const deserializeAws_json1_1DescribeComplianceByConfigRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2786,7 +2786,7 @@ const deserializeAws_json1_1DescribeComplianceByResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2830,7 +2830,7 @@ const deserializeAws_json1_1DescribeConfigRuleEvaluationStatusCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2877,7 +2877,7 @@ const deserializeAws_json1_1DescribeConfigRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2921,7 +2921,7 @@ const deserializeAws_json1_1DescribeConfigurationAggregatorsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2971,7 +2971,7 @@ const deserializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_json1_1DescribeConfigurationRecordersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3062,7 +3062,7 @@ const deserializeAws_json1_1DescribeConfigurationRecorderStatusCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3103,7 +3103,7 @@ const deserializeAws_json1_1DescribeConformancePackComplianceCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_json1_1DescribeConformancePacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3206,7 +3206,7 @@ const deserializeAws_json1_1DescribeConformancePackStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3253,7 +3253,7 @@ const deserializeAws_json1_1DescribeDeliveryChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3294,7 +3294,7 @@ const deserializeAws_json1_1DescribeDeliveryChannelStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3335,7 +3335,7 @@ const deserializeAws_json1_1DescribeOrganizationConfigRulesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3385,7 +3385,7 @@ const deserializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3435,7 +3435,7 @@ const deserializeAws_json1_1DescribeOrganizationConformancePacksCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3485,7 +3485,7 @@ const deserializeAws_json1_1DescribeOrganizationConformancePackStatusesCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3535,7 +3535,7 @@ const deserializeAws_json1_1DescribePendingAggregationRequestsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3582,7 +3582,7 @@ const deserializeAws_json1_1DescribeRemediationConfigurationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3617,7 +3617,7 @@ const deserializeAws_json1_1DescribeRemediationExceptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3661,7 +3661,7 @@ const deserializeAws_json1_1DescribeRemediationExecutionStatusCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3708,7 +3708,7 @@ const deserializeAws_json1_1DescribeRetentionConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3755,7 +3755,7 @@ const deserializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3805,7 +3805,7 @@ const deserializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3855,7 +3855,7 @@ const deserializeAws_json1_1GetAggregateConformancePackComplianceSummaryCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3905,7 +3905,7 @@ const deserializeAws_json1_1GetAggregateDiscoveredResourceCountsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3955,7 +3955,7 @@ const deserializeAws_json1_1GetAggregateResourceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4005,7 +4005,7 @@ const deserializeAws_json1_1GetComplianceDetailsByConfigRuleCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4052,7 +4052,7 @@ const deserializeAws_json1_1GetComplianceDetailsByResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4093,7 +4093,7 @@ const deserializeAws_json1_1GetComplianceSummaryByConfigRuleCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4128,7 +4128,7 @@ const deserializeAws_json1_1GetComplianceSummaryByResourceTypeCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4169,7 +4169,7 @@ const deserializeAws_json1_1GetConformancePackComplianceDetailsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4222,7 +4222,7 @@ const deserializeAws_json1_1GetConformancePackComplianceSummaryCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4269,7 +4269,7 @@ const deserializeAws_json1_1GetCustomRulePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4310,7 +4310,7 @@ const deserializeAws_json1_1GetDiscoveredResourceCountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4357,7 +4357,7 @@ const deserializeAws_json1_1GetOrganizationConfigRuleDetailedStatusCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4407,7 +4407,7 @@ const deserializeAws_json1_1GetOrganizationConformancePackDetailedStatusCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4457,7 +4457,7 @@ const deserializeAws_json1_1GetOrganizationCustomRulePolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4501,7 +4501,7 @@ const deserializeAws_json1_1GetResourceConfigHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4557,7 +4557,7 @@ const deserializeAws_json1_1GetStoredQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4601,7 +4601,7 @@ const deserializeAws_json1_1ListAggregateDiscoveredResourcesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4651,7 +4651,7 @@ const deserializeAws_json1_1ListConformancePackComplianceScoresCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4698,7 +4698,7 @@ const deserializeAws_json1_1ListDiscoveredResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4748,7 +4748,7 @@ const deserializeAws_json1_1ListStoredQueriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4792,7 +4792,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4842,7 +4842,7 @@ const deserializeAws_json1_1PutAggregationAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4880,7 +4880,7 @@ const deserializeAws_json1_1PutConfigRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4933,7 +4933,7 @@ const deserializeAws_json1_1PutConfigurationAggregatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4986,7 +4986,7 @@ const deserializeAws_json1_1PutConfigurationRecorderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5039,7 +5039,7 @@ const deserializeAws_json1_1PutConformancePackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5089,7 +5089,7 @@ const deserializeAws_json1_1PutDeliveryChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5151,7 +5151,7 @@ const deserializeAws_json1_1PutEvaluationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5198,7 +5198,7 @@ const deserializeAws_json1_1PutExternalEvaluationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5242,7 +5242,7 @@ const deserializeAws_json1_1PutOrganizationConfigRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5307,7 +5307,7 @@ const deserializeAws_json1_1PutOrganizationConformancePackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5375,7 +5375,7 @@ const deserializeAws_json1_1PutRemediationConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5419,7 +5419,7 @@ const deserializeAws_json1_1PutRemediationExceptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5460,7 +5460,7 @@ const deserializeAws_json1_1PutResourceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5510,7 +5510,7 @@ const deserializeAws_json1_1PutRetentionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5557,7 +5557,7 @@ const deserializeAws_json1_1PutStoredQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5604,7 +5604,7 @@ const deserializeAws_json1_1SelectAggregateResourceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5654,7 +5654,7 @@ const deserializeAws_json1_1SelectResourceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5701,7 +5701,7 @@ const deserializeAws_json1_1StartConfigRulesEvaluationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5748,7 +5748,7 @@ const deserializeAws_json1_1StartConfigurationRecorderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5792,7 +5792,7 @@ const deserializeAws_json1_1StartRemediationExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5836,7 +5836,7 @@ const deserializeAws_json1_1StopConfigurationRecorderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5874,7 +5874,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5918,7 +5918,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12087,6 +12087,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts index 16aca0d46c32..95b81e6eff86 100644 --- a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts @@ -90,7 +90,7 @@ const deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -372,6 +372,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-connect/src/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts index 363ef1abe12d..91f4aebd5ade 100644 --- a/clients/client-connect/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect/src/protocols/Aws_restJson1.ts @@ -5275,7 +5275,7 @@ const deserializeAws_restJson1AssociateApprovedOriginCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5331,7 +5331,7 @@ const deserializeAws_restJson1AssociateBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5387,7 +5387,7 @@ const deserializeAws_restJson1AssociateDefaultVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5440,7 +5440,7 @@ const deserializeAws_restJson1AssociateInstanceStorageConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5493,7 +5493,7 @@ const deserializeAws_restJson1AssociateLambdaFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5549,7 +5549,7 @@ const deserializeAws_restJson1AssociateLexBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5605,7 +5605,7 @@ const deserializeAws_restJson1AssociatePhoneNumberContactFlowCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5655,7 +5655,7 @@ const deserializeAws_restJson1AssociateQueueQuickConnectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5708,7 +5708,7 @@ const deserializeAws_restJson1AssociateRoutingProfileQueuesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5761,7 +5761,7 @@ const deserializeAws_restJson1AssociateSecurityKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5823,7 +5823,7 @@ const deserializeAws_restJson1ClaimPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5882,7 +5882,7 @@ const deserializeAws_restJson1CreateAgentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5944,7 +5944,7 @@ const deserializeAws_restJson1CreateContactFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6009,7 +6009,7 @@ const deserializeAws_restJson1CreateContactFlowModuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6080,7 +6080,7 @@ const deserializeAws_restJson1CreateHoursOfOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6142,7 +6142,7 @@ const deserializeAws_restJson1CreateInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6198,7 +6198,7 @@ const deserializeAws_restJson1CreateIntegrationAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6254,7 +6254,7 @@ const deserializeAws_restJson1CreateQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6316,7 +6316,7 @@ const deserializeAws_restJson1CreateQuickConnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6378,7 +6378,7 @@ const deserializeAws_restJson1CreateRoutingProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6440,7 +6440,7 @@ const deserializeAws_restJson1CreateSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6502,7 +6502,7 @@ const deserializeAws_restJson1CreateTaskTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6561,7 +6561,7 @@ const deserializeAws_restJson1CreateUseCaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6617,7 +6617,7 @@ const deserializeAws_restJson1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6679,7 +6679,7 @@ const deserializeAws_restJson1CreateUserHierarchyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6744,7 +6744,7 @@ const deserializeAws_restJson1CreateVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6800,7 +6800,7 @@ const deserializeAws_restJson1DeleteContactFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6853,7 +6853,7 @@ const deserializeAws_restJson1DeleteContactFlowModuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6906,7 +6906,7 @@ const deserializeAws_restJson1DeleteHoursOfOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6956,7 +6956,7 @@ const deserializeAws_restJson1DeleteInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7000,7 +7000,7 @@ const deserializeAws_restJson1DeleteIntegrationAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7047,7 +7047,7 @@ const deserializeAws_restJson1DeleteQuickConnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7097,7 +7097,7 @@ const deserializeAws_restJson1DeleteSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7153,7 +7153,7 @@ const deserializeAws_restJson1DeleteTaskTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7203,7 +7203,7 @@ const deserializeAws_restJson1DeleteUseCaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7250,7 +7250,7 @@ const deserializeAws_restJson1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7300,7 +7300,7 @@ const deserializeAws_restJson1DeleteUserHierarchyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7362,7 +7362,7 @@ const deserializeAws_restJson1DeleteVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7418,7 +7418,7 @@ const deserializeAws_restJson1DescribeAgentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7471,7 +7471,7 @@ const deserializeAws_restJson1DescribeContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7524,7 +7524,7 @@ const deserializeAws_restJson1DescribeContactFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7580,7 +7580,7 @@ const deserializeAws_restJson1DescribeContactFlowModuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7636,7 +7636,7 @@ const deserializeAws_restJson1DescribeHoursOfOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7689,7 +7689,7 @@ const deserializeAws_restJson1DescribeInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7736,7 +7736,7 @@ const deserializeAws_restJson1DescribeInstanceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7789,7 +7789,7 @@ const deserializeAws_restJson1DescribeInstanceStorageConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7845,7 +7845,7 @@ const deserializeAws_restJson1DescribePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7898,7 +7898,7 @@ const deserializeAws_restJson1DescribeQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7951,7 +7951,7 @@ const deserializeAws_restJson1DescribeQuickConnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8004,7 +8004,7 @@ const deserializeAws_restJson1DescribeRoutingProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8057,7 +8057,7 @@ const deserializeAws_restJson1DescribeSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8110,7 +8110,7 @@ const deserializeAws_restJson1DescribeUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8163,7 +8163,7 @@ const deserializeAws_restJson1DescribeUserHierarchyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8216,7 +8216,7 @@ const deserializeAws_restJson1DescribeUserHierarchyStructureCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8269,7 +8269,7 @@ const deserializeAws_restJson1DescribeVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8319,7 +8319,7 @@ const deserializeAws_restJson1DisassociateApprovedOriginCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8369,7 +8369,7 @@ const deserializeAws_restJson1DisassociateBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8416,7 +8416,7 @@ const deserializeAws_restJson1DisassociateInstanceStorageConfigCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8466,7 +8466,7 @@ const deserializeAws_restJson1DisassociateLambdaFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8516,7 +8516,7 @@ const deserializeAws_restJson1DisassociateLexBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8566,7 +8566,7 @@ const deserializeAws_restJson1DisassociatePhoneNumberContactFlowCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8616,7 +8616,7 @@ const deserializeAws_restJson1DisassociateQueueQuickConnectsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8666,7 +8666,7 @@ const deserializeAws_restJson1DisassociateRoutingProfileQueuesCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8716,7 +8716,7 @@ const deserializeAws_restJson1DisassociateSecurityKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8769,7 +8769,7 @@ const deserializeAws_restJson1GetContactAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8822,7 +8822,7 @@ const deserializeAws_restJson1GetCurrentMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8878,7 +8878,7 @@ const deserializeAws_restJson1GetCurrentUserDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8931,7 +8931,7 @@ const deserializeAws_restJson1GetFederationTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8990,7 +8990,7 @@ const deserializeAws_restJson1GetMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9079,7 +9079,7 @@ const deserializeAws_restJson1GetTaskTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9138,7 +9138,7 @@ const deserializeAws_restJson1ListAgentStatusesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9194,7 +9194,7 @@ const deserializeAws_restJson1ListApprovedOriginsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9250,7 +9250,7 @@ const deserializeAws_restJson1ListBotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9306,7 +9306,7 @@ const deserializeAws_restJson1ListContactFlowModulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9368,7 +9368,7 @@ const deserializeAws_restJson1ListContactFlowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9424,7 +9424,7 @@ const deserializeAws_restJson1ListContactReferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9480,7 +9480,7 @@ const deserializeAws_restJson1ListDefaultVocabulariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9536,7 +9536,7 @@ const deserializeAws_restJson1ListHoursOfOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9592,7 +9592,7 @@ const deserializeAws_restJson1ListInstanceAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9648,7 +9648,7 @@ const deserializeAws_restJson1ListInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9695,7 +9695,7 @@ const deserializeAws_restJson1ListInstanceStorageConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9754,7 +9754,7 @@ const deserializeAws_restJson1ListIntegrationAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9807,7 +9807,7 @@ const deserializeAws_restJson1ListLambdaFunctionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9863,7 +9863,7 @@ const deserializeAws_restJson1ListLexBotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9922,7 +9922,7 @@ const deserializeAws_restJson1ListPhoneNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9981,7 +9981,7 @@ const deserializeAws_restJson1ListPhoneNumbersV2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10037,7 +10037,7 @@ const deserializeAws_restJson1ListPromptsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10096,7 +10096,7 @@ const deserializeAws_restJson1ListQueueQuickConnectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10152,7 +10152,7 @@ const deserializeAws_restJson1ListQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10211,7 +10211,7 @@ const deserializeAws_restJson1ListQuickConnectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10270,7 +10270,7 @@ const deserializeAws_restJson1ListRoutingProfileQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10329,7 +10329,7 @@ const deserializeAws_restJson1ListRoutingProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10385,7 +10385,7 @@ const deserializeAws_restJson1ListSecurityKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10441,7 +10441,7 @@ const deserializeAws_restJson1ListSecurityProfilePermissionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10500,7 +10500,7 @@ const deserializeAws_restJson1ListSecurityProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10553,7 +10553,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10609,7 +10609,7 @@ const deserializeAws_restJson1ListTaskTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10665,7 +10665,7 @@ const deserializeAws_restJson1ListUseCasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10721,7 +10721,7 @@ const deserializeAws_restJson1ListUserHierarchyGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10777,7 +10777,7 @@ const deserializeAws_restJson1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10827,7 +10827,7 @@ const deserializeAws_restJson1PutUserStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10880,7 +10880,7 @@ const deserializeAws_restJson1ReleasePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10936,7 +10936,7 @@ const deserializeAws_restJson1ResumeContactRecordingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10986,7 +10986,7 @@ const deserializeAws_restJson1SearchAvailablePhoneNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11042,7 +11042,7 @@ const deserializeAws_restJson1SearchQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11101,7 +11101,7 @@ const deserializeAws_restJson1SearchRoutingProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11163,7 +11163,7 @@ const deserializeAws_restJson1SearchSecurityProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11222,7 +11222,7 @@ const deserializeAws_restJson1SearchUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11278,7 +11278,7 @@ const deserializeAws_restJson1SearchVocabulariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11334,7 +11334,7 @@ const deserializeAws_restJson1StartChatContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11384,7 +11384,7 @@ const deserializeAws_restJson1StartContactRecordingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11434,7 +11434,7 @@ const deserializeAws_restJson1StartContactStreamingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11487,7 +11487,7 @@ const deserializeAws_restJson1StartOutboundVoiceContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11546,7 +11546,7 @@ const deserializeAws_restJson1StartTaskContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11599,7 +11599,7 @@ const deserializeAws_restJson1StopContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11649,7 +11649,7 @@ const deserializeAws_restJson1StopContactRecordingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11693,7 +11693,7 @@ const deserializeAws_restJson1StopContactStreamingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11740,7 +11740,7 @@ const deserializeAws_restJson1SuspendContactRecordingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11784,7 +11784,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11840,7 +11840,7 @@ const deserializeAws_restJson1TransferContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11896,7 +11896,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11946,7 +11946,7 @@ const deserializeAws_restJson1UpdateAgentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12002,7 +12002,7 @@ const deserializeAws_restJson1UpdateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12052,7 +12052,7 @@ const deserializeAws_restJson1UpdateContactAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12099,7 +12099,7 @@ const deserializeAws_restJson1UpdateContactFlowContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12152,7 +12152,7 @@ const deserializeAws_restJson1UpdateContactFlowMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12205,7 +12205,7 @@ const deserializeAws_restJson1UpdateContactFlowModuleContentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12258,7 +12258,7 @@ const deserializeAws_restJson1UpdateContactFlowModuleMetadataCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12314,7 +12314,7 @@ const deserializeAws_restJson1UpdateContactFlowNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12367,7 +12367,7 @@ const deserializeAws_restJson1UpdateContactScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12420,7 +12420,7 @@ const deserializeAws_restJson1UpdateHoursOfOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12473,7 +12473,7 @@ const deserializeAws_restJson1UpdateInstanceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12523,7 +12523,7 @@ const deserializeAws_restJson1UpdateInstanceStorageConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12579,7 +12579,7 @@ const deserializeAws_restJson1UpdatePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12635,7 +12635,7 @@ const deserializeAws_restJson1UpdateQueueHoursOfOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12685,7 +12685,7 @@ const deserializeAws_restJson1UpdateQueueMaxContactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12735,7 +12735,7 @@ const deserializeAws_restJson1UpdateQueueNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12788,7 +12788,7 @@ const deserializeAws_restJson1UpdateQueueOutboundCallerConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12838,7 +12838,7 @@ const deserializeAws_restJson1UpdateQueueStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12888,7 +12888,7 @@ const deserializeAws_restJson1UpdateQuickConnectConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12938,7 +12938,7 @@ const deserializeAws_restJson1UpdateQuickConnectNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12988,7 +12988,7 @@ const deserializeAws_restJson1UpdateRoutingProfileConcurrencyCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13038,7 +13038,7 @@ const deserializeAws_restJson1UpdateRoutingProfileDefaultOutboundQueueCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13088,7 +13088,7 @@ const deserializeAws_restJson1UpdateRoutingProfileNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13141,7 +13141,7 @@ const deserializeAws_restJson1UpdateRoutingProfileQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13191,7 +13191,7 @@ const deserializeAws_restJson1UpdateSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13277,7 +13277,7 @@ const deserializeAws_restJson1UpdateTaskTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13330,7 +13330,7 @@ const deserializeAws_restJson1UpdateUserHierarchyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13380,7 +13380,7 @@ const deserializeAws_restJson1UpdateUserHierarchyGroupNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13433,7 +13433,7 @@ const deserializeAws_restJson1UpdateUserHierarchyStructureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13486,7 +13486,7 @@ const deserializeAws_restJson1UpdateUserIdentityInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13536,7 +13536,7 @@ const deserializeAws_restJson1UpdateUserPhoneConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13586,7 +13586,7 @@ const deserializeAws_restJson1UpdateUserRoutingProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13636,7 +13636,7 @@ const deserializeAws_restJson1UpdateUserSecurityProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16707,6 +16707,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts index 50fd6263877d..198a07b2d614 100644 --- a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts @@ -688,7 +688,7 @@ const deserializeAws_restJson1CreateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -744,7 +744,7 @@ const deserializeAws_restJson1DeleteCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -791,7 +791,7 @@ const deserializeAws_restJson1DeleteConnectInstanceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -844,7 +844,7 @@ const deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -897,7 +897,7 @@ const deserializeAws_restJson1DescribeCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -947,7 +947,7 @@ const deserializeAws_restJson1GetCampaignStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1006,7 +1006,7 @@ const deserializeAws_restJson1GetCampaignStateBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1056,7 +1056,7 @@ const deserializeAws_restJson1GetConnectInstanceConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1109,7 +1109,7 @@ const deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1162,7 +1162,7 @@ const deserializeAws_restJson1ListCampaignsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1209,7 +1209,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1259,7 +1259,7 @@ const deserializeAws_restJson1PauseCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1321,7 +1321,7 @@ const deserializeAws_restJson1PutDialRequestBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1377,7 +1377,7 @@ const deserializeAws_restJson1ResumeCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1433,7 +1433,7 @@ const deserializeAws_restJson1StartCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1495,7 +1495,7 @@ const deserializeAws_restJson1StartInstanceOnboardingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1548,7 +1548,7 @@ const deserializeAws_restJson1StopCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1604,7 +1604,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1654,7 +1654,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1704,7 +1704,7 @@ const deserializeAws_restJson1UpdateCampaignDialerConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1754,7 +1754,7 @@ const deserializeAws_restJson1UpdateCampaignNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1804,7 +1804,7 @@ const deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,6 +2384,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts index cbf39ccfca34..5d193cf7203e 100644 --- a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts @@ -296,7 +296,7 @@ const deserializeAws_restJson1CompleteAttachmentUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -355,7 +355,7 @@ const deserializeAws_restJson1CreateParticipantConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -402,7 +402,7 @@ const deserializeAws_restJson1DisconnectParticipantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -455,7 +455,7 @@ const deserializeAws_restJson1GetAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -511,7 +511,7 @@ const deserializeAws_restJson1GetTranscriptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -564,7 +564,7 @@ const deserializeAws_restJson1SendEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -617,7 +617,7 @@ const deserializeAws_restJson1SendMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -670,7 +670,7 @@ const deserializeAws_restJson1StartAttachmentUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -943,6 +943,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-controltower/src/protocols/Aws_restJson1.ts b/clients/client-controltower/src/protocols/Aws_restJson1.ts index 39a720b0fbef..23a9e5c7c7f2 100644 --- a/clients/client-controltower/src/protocols/Aws_restJson1.ts +++ b/clients/client-controltower/src/protocols/Aws_restJson1.ts @@ -162,7 +162,7 @@ const deserializeAws_restJson1DisableControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -221,7 +221,7 @@ const deserializeAws_restJson1EnableControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -280,7 +280,7 @@ const deserializeAws_restJson1GetControlOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -336,7 +336,7 @@ const deserializeAws_restJson1ListEnabledControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -552,6 +552,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts index 49fa21cad90c..ff7420a08d15 100644 --- a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts @@ -123,7 +123,7 @@ const deserializeAws_json1_1DeleteReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -167,7 +167,7 @@ const deserializeAws_json1_1DescribeReportDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -208,7 +208,7 @@ const deserializeAws_json1_1ModifyReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -252,7 +252,7 @@ const deserializeAws_json1_1PutReportDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -593,6 +593,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts index c39f72f7f10a..5c013271a04e 100644 --- a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts @@ -774,7 +774,7 @@ const deserializeAws_json1_1CreateAnomalyMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -815,7 +815,7 @@ const deserializeAws_json1_1CreateAnomalySubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -859,7 +859,7 @@ const deserializeAws_json1_1CreateCostCategoryDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -903,7 +903,7 @@ const deserializeAws_json1_1DeleteAnomalyMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -947,7 +947,7 @@ const deserializeAws_json1_1DeleteAnomalySubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -991,7 +991,7 @@ const deserializeAws_json1_1DeleteCostCategoryDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1035,7 +1035,7 @@ const deserializeAws_json1_1DescribeCostCategoryDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1079,7 +1079,7 @@ const deserializeAws_json1_1GetAnomaliesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1123,7 +1123,7 @@ const deserializeAws_json1_1GetAnomalyMonitorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1170,7 +1170,7 @@ const deserializeAws_json1_1GetAnomalySubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1217,7 +1217,7 @@ const deserializeAws_json1_1GetCostAndUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1270,7 +1270,7 @@ const deserializeAws_json1_1GetCostAndUsageWithResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1323,7 +1323,7 @@ const deserializeAws_json1_1GetCostCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1376,7 +1376,7 @@ const deserializeAws_json1_1GetCostForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1420,7 +1420,7 @@ const deserializeAws_json1_1GetDimensionValuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1473,7 +1473,7 @@ const deserializeAws_json1_1GetReservationCoverageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1520,7 +1520,7 @@ const deserializeAws_json1_1GetReservationPurchaseRecommendationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1567,7 +1567,7 @@ const deserializeAws_json1_1GetReservationUtilizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1614,7 +1614,7 @@ const deserializeAws_json1_1GetRightsizingRecommendationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1658,7 +1658,7 @@ const deserializeAws_json1_1GetSavingsPlansCoverageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1749,7 +1749,7 @@ const deserializeAws_json1_1GetSavingsPlansUtilizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_json1_1GetSavingsPlansUtilizationDetailsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_json1_1GetTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1893,7 +1893,7 @@ const deserializeAws_json1_1GetUsageForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_json1_1ListCostAllocationTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1984,7 +1984,7 @@ const deserializeAws_json1_1ListCostCategoryDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2025,7 +2025,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2069,7 +2069,7 @@ const deserializeAws_json1_1ProvideAnomalyFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2110,7 +2110,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2157,7 +2157,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2201,7 +2201,7 @@ const deserializeAws_json1_1UpdateAnomalyMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2245,7 +2245,7 @@ const deserializeAws_json1_1UpdateAnomalySubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2292,7 +2292,7 @@ const deserializeAws_json1_1UpdateCostAllocationTagsStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2333,7 +2333,7 @@ const deserializeAws_json1_1UpdateCostCategoryDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5467,6 +5467,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts index 3c2834bb15ae..c08a35523d71 100644 --- a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts +++ b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts @@ -1292,7 +1292,7 @@ const deserializeAws_restJson1AddProfileKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1366,7 +1366,7 @@ const deserializeAws_restJson1CreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1422,7 +1422,7 @@ const deserializeAws_restJson1CreateIntegrationWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1475,7 +1475,7 @@ const deserializeAws_restJson1CreateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_restJson1DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1581,7 +1581,7 @@ const deserializeAws_restJson1DeleteIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1634,7 +1634,7 @@ const deserializeAws_restJson1DeleteProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1687,7 +1687,7 @@ const deserializeAws_restJson1DeleteProfileKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_restJson1DeleteProfileObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_restJson1DeleteProfileObjectTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1843,7 +1843,7 @@ const deserializeAws_restJson1DeleteWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1905,7 +1905,7 @@ const deserializeAws_restJson1GetAutoMergingPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1982,7 +1982,7 @@ const deserializeAws_restJson1GetDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2065,7 +2065,7 @@ const deserializeAws_restJson1GetIdentityResolutionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2142,7 +2142,7 @@ const deserializeAws_restJson1GetIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2204,7 +2204,7 @@ const deserializeAws_restJson1GetMatchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2290,7 +2290,7 @@ const deserializeAws_restJson1GetProfileObjectTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2361,7 +2361,7 @@ const deserializeAws_restJson1GetProfileObjectTypeTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2435,7 +2435,7 @@ const deserializeAws_restJson1GetWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2497,7 +2497,7 @@ const deserializeAws_restJson1GetWorkflowStepsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2553,7 +2553,7 @@ const deserializeAws_restJson1ListAccountIntegrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2609,7 +2609,7 @@ const deserializeAws_restJson1ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2668,7 +2668,7 @@ const deserializeAws_restJson1ListIdentityResolutionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2724,7 +2724,7 @@ const deserializeAws_restJson1ListIntegrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2780,7 +2780,7 @@ const deserializeAws_restJson1ListProfileObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_restJson1ListProfileObjectTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2892,7 +2892,7 @@ const deserializeAws_restJson1ListProfileObjectTypeTemplatesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2945,7 +2945,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2995,7 +2995,7 @@ const deserializeAws_restJson1ListWorkflowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3048,7 +3048,7 @@ const deserializeAws_restJson1MergeProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3122,7 +3122,7 @@ const deserializeAws_restJson1PutIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3175,7 +3175,7 @@ const deserializeAws_restJson1PutProfileObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3261,7 +3261,7 @@ const deserializeAws_restJson1PutProfileObjectTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3317,7 +3317,7 @@ const deserializeAws_restJson1SearchProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3367,7 +3367,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3411,7 +3411,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3479,7 +3479,7 @@ const deserializeAws_restJson1UpdateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3532,7 +3532,7 @@ const deserializeAws_restJson1UpdateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4808,6 +4808,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts index c71fcf2dcf9a..d9085550a74f 100644 --- a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts @@ -374,7 +374,7 @@ const deserializeAws_json1_1ActivatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -424,7 +424,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -474,7 +474,7 @@ const deserializeAws_json1_1CreatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -518,7 +518,7 @@ const deserializeAws_json1_1DeactivatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -565,7 +565,7 @@ const deserializeAws_json1_1DeletePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -612,7 +612,7 @@ const deserializeAws_json1_1DescribeObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -662,7 +662,7 @@ const deserializeAws_json1_1DescribePipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -712,7 +712,7 @@ const deserializeAws_json1_1EvaluateExpressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -765,7 +765,7 @@ const deserializeAws_json1_1GetPipelineDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -815,7 +815,7 @@ const deserializeAws_json1_1ListPipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -859,7 +859,7 @@ const deserializeAws_json1_1PollForTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -906,7 +906,7 @@ const deserializeAws_json1_1PutPipelineDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -956,7 +956,7 @@ const deserializeAws_json1_1QueryObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1006,7 +1006,7 @@ const deserializeAws_json1_1RemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1056,7 +1056,7 @@ const deserializeAws_json1_1ReportTaskProgressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1109,7 +1109,7 @@ const deserializeAws_json1_1ReportTaskRunnerHeartbeatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1150,7 +1150,7 @@ const deserializeAws_json1_1SetStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_json1_1SetTaskStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1253,7 +1253,7 @@ const deserializeAws_json1_1ValidatePipelineDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2158,6 +2158,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts index 184c0fead77e..7895306b4c44 100644 --- a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts @@ -1324,7 +1324,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1365,7 +1365,7 @@ const deserializeAws_json1_1ApplyPendingMaintenanceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1406,7 +1406,7 @@ const deserializeAws_json1_1CancelReplicationTaskAssessmentRunCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1453,7 +1453,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1512,7 +1512,7 @@ const deserializeAws_json1_1CreateEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1580,7 +1580,7 @@ const deserializeAws_json1_1CreateFleetAdvisorCollectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1633,7 +1633,7 @@ const deserializeAws_json1_1CreateReplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1701,7 +1701,7 @@ const deserializeAws_json1_1CreateReplicationSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1757,7 +1757,7 @@ const deserializeAws_json1_1CreateReplicationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1813,7 +1813,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1857,7 +1857,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1904,7 +1904,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1948,7 +1948,7 @@ const deserializeAws_json1_1DeleteEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1989,7 +1989,7 @@ const deserializeAws_json1_1DeleteFleetAdvisorCollectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2033,7 +2033,7 @@ const deserializeAws_json1_1DeleteFleetAdvisorDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2077,7 +2077,7 @@ const deserializeAws_json1_1DeleteReplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2121,7 +2121,7 @@ const deserializeAws_json1_1DeleteReplicationSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2165,7 +2165,7 @@ const deserializeAws_json1_1DeleteReplicationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2209,7 +2209,7 @@ const deserializeAws_json1_1DeleteReplicationTaskAssessmentRunCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2256,7 +2256,7 @@ const deserializeAws_json1_1DescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2291,7 +2291,7 @@ const deserializeAws_json1_1DescribeApplicableIndividualAssessmentsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2338,7 +2338,7 @@ const deserializeAws_json1_1DescribeCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2379,7 +2379,7 @@ const deserializeAws_json1_1DescribeConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2420,7 +2420,7 @@ const deserializeAws_json1_1DescribeEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2461,7 +2461,7 @@ const deserializeAws_json1_1DescribeEndpointSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2496,7 +2496,7 @@ const deserializeAws_json1_1DescribeEndpointTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2531,7 +2531,7 @@ const deserializeAws_json1_1DescribeEventCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2566,7 +2566,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2601,7 +2601,7 @@ const deserializeAws_json1_1DescribeEventSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2642,7 +2642,7 @@ const deserializeAws_json1_1DescribeFleetAdvisorCollectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2683,7 +2683,7 @@ const deserializeAws_json1_1DescribeFleetAdvisorDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2724,7 +2724,7 @@ const deserializeAws_json1_1DescribeFleetAdvisorLsaAnalysisCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2765,7 +2765,7 @@ const deserializeAws_json1_1DescribeFleetAdvisorSchemaObjectSummaryCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2806,7 +2806,7 @@ const deserializeAws_json1_1DescribeFleetAdvisorSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2847,7 +2847,7 @@ const deserializeAws_json1_1DescribeOrderableReplicationInstancesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2882,7 +2882,7 @@ const deserializeAws_json1_1DescribePendingMaintenanceActionsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2923,7 +2923,7 @@ const deserializeAws_json1_1DescribeRefreshSchemasStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2967,7 +2967,7 @@ const deserializeAws_json1_1DescribeReplicationInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3008,7 +3008,7 @@ const deserializeAws_json1_1DescribeReplicationInstanceTaskLogsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3052,7 +3052,7 @@ const deserializeAws_json1_1DescribeReplicationSubnetGroupsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3093,7 +3093,7 @@ const deserializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3134,7 +3134,7 @@ const deserializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3175,7 +3175,7 @@ const deserializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3216,7 +3216,7 @@ const deserializeAws_json1_1DescribeReplicationTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3257,7 +3257,7 @@ const deserializeAws_json1_1DescribeSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3301,7 +3301,7 @@ const deserializeAws_json1_1DescribeTableStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3345,7 +3345,7 @@ const deserializeAws_json1_1ImportCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3392,7 +3392,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3433,7 +3433,7 @@ const deserializeAws_json1_1ModifyEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3486,7 +3486,7 @@ const deserializeAws_json1_1ModifyEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3551,7 +3551,7 @@ const deserializeAws_json1_1ModifyReplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3610,7 +3610,7 @@ const deserializeAws_json1_1ModifyReplicationSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3666,7 +3666,7 @@ const deserializeAws_json1_1ModifyReplicationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3716,7 +3716,7 @@ const deserializeAws_json1_1MoveReplicationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3769,7 +3769,7 @@ const deserializeAws_json1_1RebootReplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3813,7 +3813,7 @@ const deserializeAws_json1_1RefreshSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3863,7 +3863,7 @@ const deserializeAws_json1_1ReloadTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3907,7 +3907,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3948,7 +3948,7 @@ const deserializeAws_json1_1RunFleetAdvisorLsaAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3992,7 +3992,7 @@ const deserializeAws_json1_1StartReplicationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4039,7 +4039,7 @@ const deserializeAws_json1_1StartReplicationTaskAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4083,7 +4083,7 @@ const deserializeAws_json1_1StartReplicationTaskAssessmentRunCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4157,7 +4157,7 @@ const deserializeAws_json1_1StopReplicationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4201,7 +4201,7 @@ const deserializeAws_json1_1TestConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4254,7 +4254,7 @@ const deserializeAws_json1_1UpdateSubscriptionsToEventBridgeCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8533,6 +8533,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-databrew/src/protocols/Aws_restJson1.ts b/clients/client-databrew/src/protocols/Aws_restJson1.ts index 040f530b2140..5b7f89080546 100644 --- a/clients/client-databrew/src/protocols/Aws_restJson1.ts +++ b/clients/client-databrew/src/protocols/Aws_restJson1.ts @@ -1308,7 +1308,7 @@ const deserializeAws_restJson1BatchDeleteRecipeVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1355,7 +1355,7 @@ const deserializeAws_restJson1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1405,7 +1405,7 @@ const deserializeAws_restJson1CreateProfileJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1458,7 +1458,7 @@ const deserializeAws_restJson1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1508,7 +1508,7 @@ const deserializeAws_restJson1CreateRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1555,7 +1555,7 @@ const deserializeAws_restJson1CreateRecipeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1608,7 +1608,7 @@ const deserializeAws_restJson1CreateRulesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1655,7 +1655,7 @@ const deserializeAws_restJson1CreateScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1702,7 +1702,7 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1749,7 +1749,7 @@ const deserializeAws_restJson1DeleteJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1796,7 +1796,7 @@ const deserializeAws_restJson1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1846,7 +1846,7 @@ const deserializeAws_restJson1DeleteRecipeVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1893,7 +1893,7 @@ const deserializeAws_restJson1DeleteRulesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_restJson1DeleteScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2017,7 +2017,7 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2133,7 +2133,7 @@ const deserializeAws_restJson1DescribeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2234,7 +2234,7 @@ const deserializeAws_restJson1DescribeJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2317,7 +2317,7 @@ const deserializeAws_restJson1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2397,7 +2397,7 @@ const deserializeAws_restJson1DescribeRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2468,7 +2468,7 @@ const deserializeAws_restJson1DescribeRulesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2536,7 +2536,7 @@ const deserializeAws_restJson1DescribeScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2583,7 +2583,7 @@ const deserializeAws_restJson1ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2627,7 +2627,7 @@ const deserializeAws_restJson1ListJobRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2674,7 +2674,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2718,7 +2718,7 @@ const deserializeAws_restJson1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2762,7 +2762,7 @@ const deserializeAws_restJson1ListRecipesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2806,7 +2806,7 @@ const deserializeAws_restJson1ListRecipeVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2850,7 +2850,7 @@ const deserializeAws_restJson1ListRulesetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2897,7 +2897,7 @@ const deserializeAws_restJson1ListSchedulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2938,7 +2938,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2985,7 +2985,7 @@ const deserializeAws_restJson1PublishRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3038,7 +3038,7 @@ const deserializeAws_restJson1SendProjectSessionActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3085,7 +3085,7 @@ const deserializeAws_restJson1StartJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3138,7 +3138,7 @@ const deserializeAws_restJson1StartProjectSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3188,7 +3188,7 @@ const deserializeAws_restJson1StopJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3229,7 +3229,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3273,7 +3273,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3320,7 +3320,7 @@ const deserializeAws_restJson1UpdateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3367,7 +3367,7 @@ const deserializeAws_restJson1UpdateProfileJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3417,7 +3417,7 @@ const deserializeAws_restJson1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3461,7 +3461,7 @@ const deserializeAws_restJson1UpdateRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3505,7 +3505,7 @@ const deserializeAws_restJson1UpdateRecipeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3552,7 +3552,7 @@ const deserializeAws_restJson1UpdateRulesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3596,7 +3596,7 @@ const deserializeAws_restJson1UpdateScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5282,6 +5282,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts index 83db62cea695..de2cbc680ce2 100644 --- a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts +++ b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts @@ -878,7 +878,7 @@ const deserializeAws_restJson1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -961,7 +961,7 @@ const deserializeAws_restJson1CreateDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1029,7 +1029,7 @@ const deserializeAws_restJson1CreateEventActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1103,7 +1103,7 @@ const deserializeAws_restJson1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1192,7 +1192,7 @@ const deserializeAws_restJson1CreateRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1242,7 +1242,7 @@ const deserializeAws_restJson1DeleteAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1295,7 +1295,7 @@ const deserializeAws_restJson1DeleteDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1348,7 +1348,7 @@ const deserializeAws_restJson1DeleteEventActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1395,7 +1395,7 @@ const deserializeAws_restJson1DeleteRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_restJson1GetAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1558,7 +1558,7 @@ const deserializeAws_restJson1GetDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1623,7 +1623,7 @@ const deserializeAws_restJson1GetEventActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1694,7 +1694,7 @@ const deserializeAws_restJson1GetJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1777,7 +1777,7 @@ const deserializeAws_restJson1GetRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1830,7 +1830,7 @@ const deserializeAws_restJson1ListDataSetRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1883,7 +1883,7 @@ const deserializeAws_restJson1ListDataSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1936,7 +1936,7 @@ const deserializeAws_restJson1ListEventActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1989,7 +1989,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2042,7 +2042,7 @@ const deserializeAws_restJson1ListRevisionAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2092,7 +2092,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2157,7 +2157,7 @@ const deserializeAws_restJson1RevokeRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2220,7 +2220,7 @@ const deserializeAws_restJson1SendApiAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2270,7 +2270,7 @@ const deserializeAws_restJson1StartJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2323,7 +2323,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2355,7 +2355,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2417,7 +2417,7 @@ const deserializeAws_restJson1UpdateAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2500,7 +2500,7 @@ const deserializeAws_restJson1UpdateDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2568,7 +2568,7 @@ const deserializeAws_restJson1UpdateEventActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2651,7 +2651,7 @@ const deserializeAws_restJson1UpdateRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3689,6 +3689,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-datasync/src/protocols/Aws_json1_1.ts b/clients/client-datasync/src/protocols/Aws_json1_1.ts index 54bb9a26ec2c..cb92fda62b84 100644 --- a/clients/client-datasync/src/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/src/protocols/Aws_json1_1.ts @@ -829,7 +829,7 @@ const deserializeAws_json1_1CancelTaskExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -873,7 +873,7 @@ const deserializeAws_json1_1CreateAgentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -917,7 +917,7 @@ const deserializeAws_json1_1CreateLocationEfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -961,7 +961,7 @@ const deserializeAws_json1_1CreateLocationFsxLustreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1005,7 +1005,7 @@ const deserializeAws_json1_1CreateLocationFsxOntapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1049,7 +1049,7 @@ const deserializeAws_json1_1CreateLocationFsxOpenZfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1093,7 +1093,7 @@ const deserializeAws_json1_1CreateLocationFsxWindowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_json1_1CreateLocationHdfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1181,7 +1181,7 @@ const deserializeAws_json1_1CreateLocationNfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1225,7 +1225,7 @@ const deserializeAws_json1_1CreateLocationObjectStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1269,7 +1269,7 @@ const deserializeAws_json1_1CreateLocationS3CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1313,7 +1313,7 @@ const deserializeAws_json1_1CreateLocationSmbCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1357,7 +1357,7 @@ const deserializeAws_json1_1CreateTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1401,7 +1401,7 @@ const deserializeAws_json1_1DeleteAgentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1445,7 +1445,7 @@ const deserializeAws_json1_1DeleteLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1489,7 +1489,7 @@ const deserializeAws_json1_1DeleteTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1533,7 +1533,7 @@ const deserializeAws_json1_1DescribeAgentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1577,7 +1577,7 @@ const deserializeAws_json1_1DescribeLocationEfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1621,7 +1621,7 @@ const deserializeAws_json1_1DescribeLocationFsxLustreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1665,7 +1665,7 @@ const deserializeAws_json1_1DescribeLocationFsxOntapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1709,7 +1709,7 @@ const deserializeAws_json1_1DescribeLocationFsxOpenZfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1753,7 +1753,7 @@ const deserializeAws_json1_1DescribeLocationFsxWindowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1797,7 +1797,7 @@ const deserializeAws_json1_1DescribeLocationHdfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1841,7 +1841,7 @@ const deserializeAws_json1_1DescribeLocationNfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1885,7 +1885,7 @@ const deserializeAws_json1_1DescribeLocationObjectStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1929,7 +1929,7 @@ const deserializeAws_json1_1DescribeLocationS3CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1973,7 +1973,7 @@ const deserializeAws_json1_1DescribeLocationSmbCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2017,7 +2017,7 @@ const deserializeAws_json1_1DescribeTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2061,7 +2061,7 @@ const deserializeAws_json1_1DescribeTaskExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2105,7 +2105,7 @@ const deserializeAws_json1_1ListAgentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2149,7 +2149,7 @@ const deserializeAws_json1_1ListLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2193,7 +2193,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2237,7 +2237,7 @@ const deserializeAws_json1_1ListTaskExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2281,7 +2281,7 @@ const deserializeAws_json1_1ListTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2325,7 +2325,7 @@ const deserializeAws_json1_1StartTaskExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2369,7 +2369,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2413,7 +2413,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2457,7 +2457,7 @@ const deserializeAws_json1_1UpdateAgentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2501,7 +2501,7 @@ const deserializeAws_json1_1UpdateLocationHdfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2545,7 +2545,7 @@ const deserializeAws_json1_1UpdateLocationNfsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2589,7 +2589,7 @@ const deserializeAws_json1_1UpdateLocationObjectStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2633,7 +2633,7 @@ const deserializeAws_json1_1UpdateLocationSmbCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2677,7 +2677,7 @@ const deserializeAws_json1_1UpdateTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2721,7 +2721,7 @@ const deserializeAws_json1_1UpdateTaskExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4372,6 +4372,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-dax/src/protocols/Aws_json1_1.ts b/clients/client-dax/src/protocols/Aws_json1_1.ts index 229364d37e3c..0f1bef750764 100644 --- a/clients/client-dax/src/protocols/Aws_json1_1.ts +++ b/clients/client-dax/src/protocols/Aws_json1_1.ts @@ -446,7 +446,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -529,7 +529,7 @@ const deserializeAws_json1_1CreateParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -585,7 +585,7 @@ const deserializeAws_json1_1CreateSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -638,7 +638,7 @@ const deserializeAws_json1_1DecreaseReplicationFactorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -694,7 +694,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -747,7 +747,7 @@ const deserializeAws_json1_1DeleteParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -800,7 +800,7 @@ const deserializeAws_json1_1DeleteSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -847,7 +847,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -897,7 +897,7 @@ const deserializeAws_json1_1DescribeDefaultParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -944,7 +944,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -991,7 +991,7 @@ const deserializeAws_json1_1DescribeParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1041,7 +1041,7 @@ const deserializeAws_json1_1DescribeParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1091,7 +1091,7 @@ const deserializeAws_json1_1DescribeSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1135,7 +1135,7 @@ const deserializeAws_json1_1IncreaseReplicationFactorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1256,7 +1256,7 @@ const deserializeAws_json1_1RebootNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1312,7 +1312,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1371,7 +1371,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1430,7 +1430,7 @@ const deserializeAws_json1_1UpdateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1489,7 +1489,7 @@ const deserializeAws_json1_1UpdateParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1542,7 +1542,7 @@ const deserializeAws_json1_1UpdateSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3011,6 +3011,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-detective/src/protocols/Aws_restJson1.ts b/clients/client-detective/src/protocols/Aws_restJson1.ts index c28f89b02a70..023fbb1cc8c2 100644 --- a/clients/client-detective/src/protocols/Aws_restJson1.ts +++ b/clients/client-detective/src/protocols/Aws_restJson1.ts @@ -722,7 +722,7 @@ const deserializeAws_restJson1AcceptInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -775,7 +775,7 @@ const deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -828,7 +828,7 @@ const deserializeAws_restJson1BatchGetMembershipDatasourcesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -875,7 +875,7 @@ const deserializeAws_restJson1CreateGraphCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_restJson1CreateMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -972,7 +972,7 @@ const deserializeAws_restJson1DeleteGraphCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1022,7 +1022,7 @@ const deserializeAws_restJson1DeleteMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1072,7 +1072,7 @@ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1116,7 +1116,7 @@ const deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1160,7 +1160,7 @@ const deserializeAws_restJson1DisassociateMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1207,7 +1207,7 @@ const deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1257,7 +1257,7 @@ const deserializeAws_restJson1GetMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1310,7 +1310,7 @@ const deserializeAws_restJson1ListDatasourcePackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1360,7 +1360,7 @@ const deserializeAws_restJson1ListGraphsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1407,7 +1407,7 @@ const deserializeAws_restJson1ListInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1454,7 +1454,7 @@ const deserializeAws_restJson1ListMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1504,7 +1504,7 @@ const deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1551,7 +1551,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1595,7 +1595,7 @@ const deserializeAws_restJson1RejectInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1642,7 +1642,7 @@ const deserializeAws_restJson1StartMonitoringMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1692,7 +1692,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1736,7 +1736,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1780,7 +1780,7 @@ const deserializeAws_restJson1UpdateDatasourcePackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1827,7 +1827,7 @@ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2363,6 +2363,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-device-farm/src/protocols/Aws_json1_1.ts b/clients/client-device-farm/src/protocols/Aws_json1_1.ts index fb48763e5fab..6b2cce81bef3 100644 --- a/clients/client-device-farm/src/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/src/protocols/Aws_json1_1.ts @@ -1439,7 +1439,7 @@ const deserializeAws_json1_1CreateDevicePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1489,7 +1489,7 @@ const deserializeAws_json1_1CreateInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1539,7 +1539,7 @@ const deserializeAws_json1_1CreateNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1589,7 +1589,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1642,7 +1642,7 @@ const deserializeAws_json1_1CreateRemoteAccessSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1692,7 +1692,7 @@ const deserializeAws_json1_1CreateTestGridProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1739,7 +1739,7 @@ const deserializeAws_json1_1CreateTestGridUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1786,7 +1786,7 @@ const deserializeAws_json1_1CreateUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1836,7 +1836,7 @@ const deserializeAws_json1_1CreateVPCEConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1883,7 +1883,7 @@ const deserializeAws_json1_1DeleteDevicePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1933,7 +1933,7 @@ const deserializeAws_json1_1DeleteInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1983,7 +1983,7 @@ const deserializeAws_json1_1DeleteNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2033,7 +2033,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2083,7 +2083,7 @@ const deserializeAws_json1_1DeleteRemoteAccessSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2133,7 +2133,7 @@ const deserializeAws_json1_1DeleteRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2183,7 +2183,7 @@ const deserializeAws_json1_1DeleteTestGridProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2233,7 +2233,7 @@ const deserializeAws_json1_1DeleteUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2283,7 +2283,7 @@ const deserializeAws_json1_1DeleteVPCEConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2333,7 +2333,7 @@ const deserializeAws_json1_1GetAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2383,7 +2383,7 @@ const deserializeAws_json1_1GetDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2433,7 +2433,7 @@ const deserializeAws_json1_1GetDeviceInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2483,7 +2483,7 @@ const deserializeAws_json1_1GetDevicePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2533,7 +2533,7 @@ const deserializeAws_json1_1GetDevicePoolCompatibilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2583,7 +2583,7 @@ const deserializeAws_json1_1GetInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2633,7 +2633,7 @@ const deserializeAws_json1_1GetJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2683,7 +2683,7 @@ const deserializeAws_json1_1GetNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2733,7 +2733,7 @@ const deserializeAws_json1_1GetOfferingStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2786,7 +2786,7 @@ const deserializeAws_json1_1GetProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_json1_1GetRemoteAccessSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2886,7 +2886,7 @@ const deserializeAws_json1_1GetRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2936,7 +2936,7 @@ const deserializeAws_json1_1GetSuiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2986,7 +2986,7 @@ const deserializeAws_json1_1GetTestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3036,7 +3036,7 @@ const deserializeAws_json1_1GetTestGridProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3083,7 +3083,7 @@ const deserializeAws_json1_1GetTestGridSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3130,7 +3130,7 @@ const deserializeAws_json1_1GetUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3180,7 +3180,7 @@ const deserializeAws_json1_1GetVPCEConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3227,7 +3227,7 @@ const deserializeAws_json1_1InstallToRemoteAccessSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3277,7 +3277,7 @@ const deserializeAws_json1_1ListArtifactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3327,7 +3327,7 @@ const deserializeAws_json1_1ListDeviceInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3377,7 +3377,7 @@ const deserializeAws_json1_1ListDevicePoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3427,7 +3427,7 @@ const deserializeAws_json1_1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3477,7 +3477,7 @@ const deserializeAws_json1_1ListInstanceProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3527,7 +3527,7 @@ const deserializeAws_json1_1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3577,7 +3577,7 @@ const deserializeAws_json1_1ListNetworkProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3627,7 +3627,7 @@ const deserializeAws_json1_1ListOfferingPromotionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3680,7 +3680,7 @@ const deserializeAws_json1_1ListOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3733,7 +3733,7 @@ const deserializeAws_json1_1ListOfferingTransactionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,7 +3786,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3836,7 +3836,7 @@ const deserializeAws_json1_1ListRemoteAccessSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3886,7 +3886,7 @@ const deserializeAws_json1_1ListRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3936,7 +3936,7 @@ const deserializeAws_json1_1ListSamplesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3986,7 +3986,7 @@ const deserializeAws_json1_1ListSuitesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4036,7 +4036,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4083,7 +4083,7 @@ const deserializeAws_json1_1ListTestGridProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4127,7 +4127,7 @@ const deserializeAws_json1_1ListTestGridSessionActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4174,7 +4174,7 @@ const deserializeAws_json1_1ListTestGridSessionArtifactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4221,7 +4221,7 @@ const deserializeAws_json1_1ListTestGridSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4268,7 +4268,7 @@ const deserializeAws_json1_1ListTestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4318,7 +4318,7 @@ const deserializeAws_json1_1ListUniqueProblemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4368,7 +4368,7 @@ const deserializeAws_json1_1ListUploadsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4418,7 +4418,7 @@ const deserializeAws_json1_1ListVPCEConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4462,7 +4462,7 @@ const deserializeAws_json1_1PurchaseOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4515,7 +4515,7 @@ const deserializeAws_json1_1RenewOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4568,7 +4568,7 @@ const deserializeAws_json1_1ScheduleRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4621,7 +4621,7 @@ const deserializeAws_json1_1StopJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4671,7 +4671,7 @@ const deserializeAws_json1_1StopRemoteAccessSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4721,7 +4721,7 @@ const deserializeAws_json1_1StopRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4771,7 +4771,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4824,7 +4824,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4871,7 +4871,7 @@ const deserializeAws_json1_1UpdateDeviceInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4921,7 +4921,7 @@ const deserializeAws_json1_1UpdateDevicePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4971,7 +4971,7 @@ const deserializeAws_json1_1UpdateInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5021,7 +5021,7 @@ const deserializeAws_json1_1UpdateNetworkProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5071,7 +5071,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5121,7 +5121,7 @@ const deserializeAws_json1_1UpdateTestGridProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5171,7 +5171,7 @@ const deserializeAws_json1_1UpdateUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5221,7 +5221,7 @@ const deserializeAws_json1_1UpdateVPCEConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8348,6 +8348,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts index 84124df36ffd..4c86b8ddb441 100644 --- a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts +++ b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts @@ -1080,7 +1080,7 @@ const deserializeAws_restJson1AddNotificationChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1136,7 +1136,7 @@ const deserializeAws_restJson1DeleteInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1201,7 +1201,7 @@ const deserializeAws_restJson1DescribeAccountHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1257,7 +1257,7 @@ const deserializeAws_restJson1DescribeAccountOverviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1310,7 +1310,7 @@ const deserializeAws_restJson1DescribeAnomalyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1363,7 +1363,7 @@ const deserializeAws_restJson1DescribeEventSourcesConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1413,7 +1413,7 @@ const deserializeAws_restJson1DescribeFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1469,7 +1469,7 @@ const deserializeAws_restJson1DescribeInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_restJson1DescribeOrganizationHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1584,7 +1584,7 @@ const deserializeAws_restJson1DescribeOrganizationOverviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1646,7 +1646,7 @@ const deserializeAws_restJson1DescribeOrganizationResourceCollectionHealthComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_restJson1DescribeResourceCollectionHealthCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1755,7 +1755,7 @@ const deserializeAws_restJson1DescribeServiceIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1826,7 +1826,7 @@ const deserializeAws_restJson1GetCostEstimationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1882,7 +1882,7 @@ const deserializeAws_restJson1GetResourceCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1941,7 +1941,7 @@ const deserializeAws_restJson1ListAnomaliesForInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2000,7 +2000,7 @@ const deserializeAws_restJson1ListAnomalousLogGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2056,7 +2056,7 @@ const deserializeAws_restJson1ListEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2115,7 +2115,7 @@ const deserializeAws_restJson1ListInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2171,7 +2171,7 @@ const deserializeAws_restJson1ListMonitoredResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2224,7 +2224,7 @@ const deserializeAws_restJson1ListNotificationChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2280,7 +2280,7 @@ const deserializeAws_restJson1ListOrganizationInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2333,7 +2333,7 @@ const deserializeAws_restJson1ListRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2383,7 +2383,7 @@ const deserializeAws_restJson1PutFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2436,7 +2436,7 @@ const deserializeAws_restJson1RemoveNotificationChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2498,7 +2498,7 @@ const deserializeAws_restJson1SearchInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2554,7 +2554,7 @@ const deserializeAws_restJson1SearchOrganizationInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2601,7 +2601,7 @@ const deserializeAws_restJson1StartCostEstimationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2654,7 +2654,7 @@ const deserializeAws_restJson1UpdateEventSourcesConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2701,7 +2701,7 @@ const deserializeAws_restJson1UpdateResourceCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2751,7 +2751,7 @@ const deserializeAws_restJson1UpdateServiceIntegrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4990,6 +4990,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts index e8a8a6c97b14..caffa2f832df 100644 --- a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts @@ -1192,7 +1192,7 @@ const deserializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1236,7 +1236,7 @@ const deserializeAws_json1_1AllocateConnectionOnInterconnectCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1280,7 +1280,7 @@ const deserializeAws_json1_1AllocateHostedConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1330,7 +1330,7 @@ const deserializeAws_json1_1AllocatePrivateVirtualInterfaceCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1380,7 +1380,7 @@ const deserializeAws_json1_1AllocatePublicVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1430,7 +1430,7 @@ const deserializeAws_json1_1AllocateTransitVirtualInterfaceCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1480,7 +1480,7 @@ const deserializeAws_json1_1AssociateConnectionWithLagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1524,7 +1524,7 @@ const deserializeAws_json1_1AssociateHostedConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1568,7 +1568,7 @@ const deserializeAws_json1_1AssociateMacSecKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1612,7 +1612,7 @@ const deserializeAws_json1_1AssociateVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1656,7 +1656,7 @@ const deserializeAws_json1_1ConfirmConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1700,7 +1700,7 @@ const deserializeAws_json1_1ConfirmCustomerAgreementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1744,7 +1744,7 @@ const deserializeAws_json1_1ConfirmPrivateVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1788,7 +1788,7 @@ const deserializeAws_json1_1ConfirmPublicVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1832,7 +1832,7 @@ const deserializeAws_json1_1ConfirmTransitVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1876,7 +1876,7 @@ const deserializeAws_json1_1CreateBGPPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1920,7 +1920,7 @@ const deserializeAws_json1_1CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1970,7 +1970,7 @@ const deserializeAws_json1_1CreateDirectConnectGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2014,7 +2014,7 @@ const deserializeAws_json1_1CreateDirectConnectGatewayAssociationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2058,7 +2058,7 @@ const deserializeAws_json1_1CreateDirectConnectGatewayAssociationProposalCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2102,7 +2102,7 @@ const deserializeAws_json1_1CreateInterconnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2152,7 +2152,7 @@ const deserializeAws_json1_1CreateLagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2202,7 +2202,7 @@ const deserializeAws_json1_1CreatePrivateVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2252,7 +2252,7 @@ const deserializeAws_json1_1CreatePublicVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2302,7 +2302,7 @@ const deserializeAws_json1_1CreateTransitVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2352,7 +2352,7 @@ const deserializeAws_json1_1DeleteBGPPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2396,7 +2396,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2440,7 +2440,7 @@ const deserializeAws_json1_1DeleteDirectConnectGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2484,7 +2484,7 @@ const deserializeAws_json1_1DeleteDirectConnectGatewayAssociationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2528,7 +2528,7 @@ const deserializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2572,7 +2572,7 @@ const deserializeAws_json1_1DeleteInterconnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2616,7 +2616,7 @@ const deserializeAws_json1_1DeleteLagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2660,7 +2660,7 @@ const deserializeAws_json1_1DeleteVirtualInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2704,7 +2704,7 @@ const deserializeAws_json1_1DescribeConnectionLoaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2748,7 +2748,7 @@ const deserializeAws_json1_1DescribeConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2792,7 +2792,7 @@ const deserializeAws_json1_1DescribeConnectionsOnInterconnectCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_json1_1DescribeCustomerMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2880,7 +2880,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsComm ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2924,7 +2924,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewayAssociationsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2968,7 +2968,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewayAttachmentsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3012,7 +3012,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3056,7 +3056,7 @@ const deserializeAws_json1_1DescribeHostedConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3100,7 +3100,7 @@ const deserializeAws_json1_1DescribeInterconnectLoaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3144,7 +3144,7 @@ const deserializeAws_json1_1DescribeInterconnectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3188,7 +3188,7 @@ const deserializeAws_json1_1DescribeLagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3232,7 +3232,7 @@ const deserializeAws_json1_1DescribeLoaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3276,7 +3276,7 @@ const deserializeAws_json1_1DescribeLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3320,7 +3320,7 @@ const deserializeAws_json1_1DescribeRouterConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3364,7 +3364,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3408,7 +3408,7 @@ const deserializeAws_json1_1DescribeVirtualGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3452,7 +3452,7 @@ const deserializeAws_json1_1DescribeVirtualInterfacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3496,7 +3496,7 @@ const deserializeAws_json1_1DisassociateConnectionFromLagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3540,7 +3540,7 @@ const deserializeAws_json1_1DisassociateMacSecKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3584,7 +3584,7 @@ const deserializeAws_json1_1ListVirtualInterfaceTestHistoryCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3628,7 +3628,7 @@ const deserializeAws_json1_1StartBgpFailoverTestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3672,7 +3672,7 @@ const deserializeAws_json1_1StopBgpFailoverTestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3716,7 +3716,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3766,7 +3766,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3810,7 +3810,7 @@ const deserializeAws_json1_1UpdateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3854,7 +3854,7 @@ const deserializeAws_json1_1UpdateDirectConnectGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3898,7 +3898,7 @@ const deserializeAws_json1_1UpdateDirectConnectGatewayAssociationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3942,7 +3942,7 @@ const deserializeAws_json1_1UpdateLagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3986,7 +3986,7 @@ const deserializeAws_json1_1UpdateVirtualInterfaceAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6004,6 +6004,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-directory-service/src/protocols/Aws_json1_1.ts b/clients/client-directory-service/src/protocols/Aws_json1_1.ts index 0dee8c918070..1df9eb7447d0 100644 --- a/clients/client-directory-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/src/protocols/Aws_json1_1.ts @@ -1238,7 +1238,7 @@ const deserializeAws_json1_1AcceptSharedDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1291,7 +1291,7 @@ const deserializeAws_json1_1AddIpRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1350,7 +1350,7 @@ const deserializeAws_json1_1AddRegionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1418,7 +1418,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1471,7 +1471,7 @@ const deserializeAws_json1_1CancelSchemaExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1518,7 +1518,7 @@ const deserializeAws_json1_1ConnectDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1568,7 +1568,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1621,7 +1621,7 @@ const deserializeAws_json1_1CreateComputerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1683,7 +1683,7 @@ const deserializeAws_json1_1CreateConditionalForwarderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1742,7 +1742,7 @@ const deserializeAws_json1_1CreateDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1792,7 +1792,7 @@ const deserializeAws_json1_1CreateLogSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1848,7 +1848,7 @@ const deserializeAws_json1_1CreateMicrosoftADCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1901,7 +1901,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1954,7 +1954,7 @@ const deserializeAws_json1_1CreateTrustCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2010,7 +2010,7 @@ const deserializeAws_json1_1DeleteConditionalForwarderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2066,7 +2066,7 @@ const deserializeAws_json1_1DeleteDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2113,7 +2113,7 @@ const deserializeAws_json1_1DeleteLogSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2163,7 +2163,7 @@ const deserializeAws_json1_1DeleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2213,7 +2213,7 @@ const deserializeAws_json1_1DeleteTrustCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2266,7 +2266,7 @@ const deserializeAws_json1_1DeregisterCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2328,7 +2328,7 @@ const deserializeAws_json1_1DeregisterEventTopicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2378,7 +2378,7 @@ const deserializeAws_json1_1DescribeCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2434,7 +2434,7 @@ const deserializeAws_json1_1DescribeClientAuthenticationSettingsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2490,7 +2490,7 @@ const deserializeAws_json1_1DescribeConditionalForwardersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2546,7 +2546,7 @@ const deserializeAws_json1_1DescribeDirectoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2599,7 +2599,7 @@ const deserializeAws_json1_1DescribeDomainControllersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2655,7 +2655,7 @@ const deserializeAws_json1_1DescribeEventTopicsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2705,7 +2705,7 @@ const deserializeAws_json1_1DescribeLDAPSSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2761,7 +2761,7 @@ const deserializeAws_json1_1DescribeRegionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2820,7 +2820,7 @@ const deserializeAws_json1_1DescribeSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2876,7 +2876,7 @@ const deserializeAws_json1_1DescribeSharedDirectoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2932,7 +2932,7 @@ const deserializeAws_json1_1DescribeSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2985,7 +2985,7 @@ const deserializeAws_json1_1DescribeTrustsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3041,7 +3041,7 @@ const deserializeAws_json1_1DisableClientAuthenticationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3097,7 +3097,7 @@ const deserializeAws_json1_1DisableLDAPSCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_json1_1DisableRadiusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3203,7 +3203,7 @@ const deserializeAws_json1_1DisableSsoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3256,7 +3256,7 @@ const deserializeAws_json1_1EnableClientAuthenticationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3315,7 +3315,7 @@ const deserializeAws_json1_1EnableLDAPSCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3377,7 +3377,7 @@ const deserializeAws_json1_1EnableRadiusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3430,7 +3430,7 @@ const deserializeAws_json1_1EnableSsoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3483,7 +3483,7 @@ const deserializeAws_json1_1GetDirectoryLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3530,7 +3530,7 @@ const deserializeAws_json1_1GetSnapshotLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3577,7 +3577,7 @@ const deserializeAws_json1_1ListCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3633,7 +3633,7 @@ const deserializeAws_json1_1ListIpRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3686,7 +3686,7 @@ const deserializeAws_json1_1ListLogSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3736,7 +3736,7 @@ const deserializeAws_json1_1ListSchemaExtensionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,7 +3786,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3839,7 +3839,7 @@ const deserializeAws_json1_1RegisterCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3904,7 +3904,7 @@ const deserializeAws_json1_1RegisterEventTopicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3954,7 +3954,7 @@ const deserializeAws_json1_1RejectSharedDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4007,7 +4007,7 @@ const deserializeAws_json1_1RemoveIpRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4060,7 +4060,7 @@ const deserializeAws_json1_1RemoveRegionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4116,7 +4116,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4166,7 +4166,7 @@ const deserializeAws_json1_1ResetUserPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4225,7 +4225,7 @@ const deserializeAws_json1_1RestoreFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4275,7 +4275,7 @@ const deserializeAws_json1_1ShareDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4343,7 +4343,7 @@ const deserializeAws_json1_1StartSchemaExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4399,7 +4399,7 @@ const deserializeAws_json1_1UnshareDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4452,7 +4452,7 @@ const deserializeAws_json1_1UpdateConditionalForwarderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4508,7 +4508,7 @@ const deserializeAws_json1_1UpdateNumberOfDomainControllersCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4567,7 +4567,7 @@ const deserializeAws_json1_1UpdateRadiusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4617,7 +4617,7 @@ const deserializeAws_json1_1UpdateSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4679,7 +4679,7 @@ const deserializeAws_json1_1UpdateTrustCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4729,7 +4729,7 @@ const deserializeAws_json1_1VerifyTrustCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7687,6 +7687,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-dlm/src/protocols/Aws_restJson1.ts b/clients/client-dlm/src/protocols/Aws_restJson1.ts index b86fbb839403..97fb5288d527 100644 --- a/clients/client-dlm/src/protocols/Aws_restJson1.ts +++ b/clients/client-dlm/src/protocols/Aws_restJson1.ts @@ -294,7 +294,7 @@ const deserializeAws_restJson1CreateLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -338,7 +338,7 @@ const deserializeAws_restJson1DeleteLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -385,7 +385,7 @@ const deserializeAws_restJson1GetLifecyclePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -435,7 +435,7 @@ const deserializeAws_restJson1GetLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -482,7 +482,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -526,7 +526,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -570,7 +570,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -614,7 +614,7 @@ const deserializeAws_restJson1UpdateLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1576,6 +1576,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-docdb/src/protocols/Aws_query.ts b/clients/client-docdb/src/protocols/Aws_query.ts index 3e6895da6d14..4e0ce08490e7 100644 --- a/clients/client-docdb/src/protocols/Aws_query.ts +++ b/clients/client-docdb/src/protocols/Aws_query.ts @@ -1262,7 +1262,7 @@ const deserializeAws_queryAddSourceIdentifierToSubscriptionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1303,7 +1303,7 @@ const deserializeAws_queryAddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1350,7 +1350,7 @@ const deserializeAws_queryApplyPendingMaintenanceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1397,7 +1397,7 @@ const deserializeAws_queryCopyDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1444,7 +1444,7 @@ const deserializeAws_queryCopyDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1500,7 +1500,7 @@ const deserializeAws_queryCreateDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1589,7 +1589,7 @@ const deserializeAws_queryCreateDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1633,7 +1633,7 @@ const deserializeAws_queryCreateDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1686,7 +1686,7 @@ const deserializeAws_queryCreateDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1769,7 +1769,7 @@ const deserializeAws_queryCreateDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1822,7 +1822,7 @@ const deserializeAws_queryCreateEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1881,7 +1881,7 @@ const deserializeAws_queryCreateGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1931,7 +1931,7 @@ const deserializeAws_queryDeleteDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1981,7 +1981,7 @@ const deserializeAws_queryDeleteDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2025,7 +2025,7 @@ const deserializeAws_queryDeleteDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2069,7 +2069,7 @@ const deserializeAws_queryDeleteDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2119,7 +2119,7 @@ const deserializeAws_queryDeleteDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2166,7 +2166,7 @@ const deserializeAws_queryDeleteEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2210,7 +2210,7 @@ const deserializeAws_queryDeleteGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2254,7 +2254,7 @@ const deserializeAws_queryDescribeCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2295,7 +2295,7 @@ const deserializeAws_queryDescribeDBClusterParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2336,7 +2336,7 @@ const deserializeAws_queryDescribeDBClusterParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2377,7 +2377,7 @@ const deserializeAws_queryDescribeDBClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2421,7 +2421,7 @@ const deserializeAws_queryDescribeDBClusterSnapshotAttributesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2462,7 +2462,7 @@ const deserializeAws_queryDescribeDBClusterSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2503,7 +2503,7 @@ const deserializeAws_queryDescribeDBEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2538,7 +2538,7 @@ const deserializeAws_queryDescribeDBInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2579,7 +2579,7 @@ const deserializeAws_queryDescribeDBSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2623,7 +2623,7 @@ const deserializeAws_queryDescribeEngineDefaultClusterParametersCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2658,7 +2658,7 @@ const deserializeAws_queryDescribeEventCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2693,7 +2693,7 @@ const deserializeAws_queryDescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2728,7 +2728,7 @@ const deserializeAws_queryDescribeEventSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2769,7 +2769,7 @@ const deserializeAws_queryDescribeGlobalClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2813,7 +2813,7 @@ const deserializeAws_queryDescribeOrderableDBInstanceOptionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2851,7 +2851,7 @@ const deserializeAws_queryDescribePendingMaintenanceActionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2892,7 +2892,7 @@ const deserializeAws_queryFailoverDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2939,7 +2939,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2986,7 +2986,7 @@ const deserializeAws_queryModifyDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3057,7 +3057,7 @@ const deserializeAws_queryModifyDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3104,7 +3104,7 @@ const deserializeAws_queryModifyDBClusterSnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3151,7 +3151,7 @@ const deserializeAws_queryModifyDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3228,7 +3228,7 @@ const deserializeAws_queryModifyDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3281,7 +3281,7 @@ const deserializeAws_queryModifyEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3337,7 +3337,7 @@ const deserializeAws_queryModifyGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3381,7 +3381,7 @@ const deserializeAws_queryRebootDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3425,7 +3425,7 @@ const deserializeAws_queryRemoveFromGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3475,7 +3475,7 @@ const deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3516,7 +3516,7 @@ const deserializeAws_queryRemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3563,7 +3563,7 @@ const deserializeAws_queryResetDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3607,7 +3607,7 @@ const deserializeAws_queryRestoreDBClusterFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3687,7 +3687,7 @@ const deserializeAws_queryRestoreDBClusterToPointInTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3770,7 +3770,7 @@ const deserializeAws_queryStartDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3817,7 +3817,7 @@ const deserializeAws_queryStopDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9100,6 +9100,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-drs/src/protocols/Aws_restJson1.ts b/clients/client-drs/src/protocols/Aws_restJson1.ts index de82d5e07e33..b078e781df1a 100644 --- a/clients/client-drs/src/protocols/Aws_restJson1.ts +++ b/clients/client-drs/src/protocols/Aws_restJson1.ts @@ -1131,7 +1131,7 @@ const deserializeAws_restJson1CreateExtendedSourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1238,7 +1238,7 @@ const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1291,7 +1291,7 @@ const deserializeAws_restJson1DeleteJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1341,7 +1341,7 @@ const deserializeAws_restJson1DeleteRecoveryInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1391,7 +1391,7 @@ const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1441,7 +1441,7 @@ const deserializeAws_restJson1DeleteSourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1497,7 +1497,7 @@ const deserializeAws_restJson1DescribeJobLogItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1550,7 +1550,7 @@ const deserializeAws_restJson1DescribeJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1603,7 +1603,7 @@ const deserializeAws_restJson1DescribeRecoveryInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1656,7 +1656,7 @@ const deserializeAws_restJson1DescribeRecoverySnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1712,7 +1712,7 @@ const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1768,7 +1768,7 @@ const deserializeAws_restJson1DescribeSourceServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1815,7 +1815,7 @@ const deserializeAws_restJson1DisconnectRecoveryInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1895,7 +1895,7 @@ const deserializeAws_restJson1DisconnectSourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1957,7 +1957,7 @@ const deserializeAws_restJson1GetFailbackReplicationConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2028,7 +2028,7 @@ const deserializeAws_restJson1GetLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2129,7 +2129,7 @@ const deserializeAws_restJson1GetReplicationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2179,7 +2179,7 @@ const deserializeAws_restJson1InitializeServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2232,7 +2232,7 @@ const deserializeAws_restJson1ListExtensibleSourceServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2288,7 +2288,7 @@ const deserializeAws_restJson1ListStagingAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2341,7 +2341,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2418,7 +2418,7 @@ const deserializeAws_restJson1RetryDataReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2471,7 +2471,7 @@ const deserializeAws_restJson1StartFailbackLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2527,7 +2527,7 @@ const deserializeAws_restJson1StartRecoveryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2577,7 +2577,7 @@ const deserializeAws_restJson1StopFailbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2624,7 +2624,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2677,7 +2677,7 @@ const deserializeAws_restJson1TerminateRecoveryInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2727,7 +2727,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2777,7 +2777,7 @@ const deserializeAws_restJson1UpdateFailbackReplicationConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2851,7 +2851,7 @@ const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2958,7 +2958,7 @@ const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3065,7 +3065,7 @@ const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4374,6 +4374,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts index 702e5cf486c8..1119670e9f70 100644 --- a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts @@ -123,7 +123,7 @@ const deserializeAws_json1_0DescribeStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -167,7 +167,7 @@ const deserializeAws_json1_0GetRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -220,7 +220,7 @@ const deserializeAws_json1_0GetShardIteratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -267,7 +267,7 @@ const deserializeAws_json1_0ListStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -759,6 +759,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts index abcfd80dea37..54f4383609d7 100644 --- a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts @@ -1077,7 +1077,7 @@ const deserializeAws_json1_0BatchExecuteStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1121,7 +1121,7 @@ const deserializeAws_json1_0BatchGetItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1174,7 +1174,7 @@ const deserializeAws_json1_0BatchWriteItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1230,7 +1230,7 @@ const deserializeAws_json1_0CreateBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1289,7 +1289,7 @@ const deserializeAws_json1_0CreateGlobalTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1342,7 +1342,7 @@ const deserializeAws_json1_0CreateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1392,7 +1392,7 @@ const deserializeAws_json1_0DeleteBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1445,7 +1445,7 @@ const deserializeAws_json1_0DeleteItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1507,7 +1507,7 @@ const deserializeAws_json1_0DeleteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1560,7 +1560,7 @@ const deserializeAws_json1_0DescribeBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1607,7 +1607,7 @@ const deserializeAws_json1_0DescribeContinuousBackupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1654,7 +1654,7 @@ const deserializeAws_json1_0DescribeContributorInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1698,7 +1698,7 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1733,7 +1733,7 @@ const deserializeAws_json1_0DescribeExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1780,7 +1780,7 @@ const deserializeAws_json1_0DescribeGlobalTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1827,7 +1827,7 @@ const deserializeAws_json1_0DescribeGlobalTableSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1874,7 +1874,7 @@ const deserializeAws_json1_0DescribeImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1915,7 +1915,7 @@ const deserializeAws_json1_0DescribeKinesisStreamingDestinationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1962,7 +1962,7 @@ const deserializeAws_json1_0DescribeLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2006,7 +2006,7 @@ const deserializeAws_json1_0DescribeTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2053,7 +2053,7 @@ const deserializeAws_json1_0DescribeTableReplicaAutoScalingCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2097,7 +2097,7 @@ const deserializeAws_json1_0DescribeTimeToLiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2144,7 +2144,7 @@ const deserializeAws_json1_0DisableKinesisStreamingDestinationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2197,7 +2197,7 @@ const deserializeAws_json1_0EnableKinesisStreamingDestinationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2250,7 +2250,7 @@ const deserializeAws_json1_0ExecuteStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2312,7 +2312,7 @@ const deserializeAws_json1_0ExecuteTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2371,7 +2371,7 @@ const deserializeAws_json1_0ExportTableToPointInTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2427,7 +2427,7 @@ const deserializeAws_json1_0GetItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2480,7 +2480,7 @@ const deserializeAws_json1_0ImportTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2527,7 +2527,7 @@ const deserializeAws_json1_0ListBackupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2571,7 +2571,7 @@ const deserializeAws_json1_0ListContributorInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2615,7 +2615,7 @@ const deserializeAws_json1_0ListExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2659,7 +2659,7 @@ const deserializeAws_json1_0ListGlobalTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2703,7 +2703,7 @@ const deserializeAws_json1_0ListImportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2744,7 +2744,7 @@ const deserializeAws_json1_0ListTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2788,7 +2788,7 @@ const deserializeAws_json1_0ListTagsOfResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2835,7 +2835,7 @@ const deserializeAws_json1_0PutItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2897,7 +2897,7 @@ const deserializeAws_json1_0QueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2950,7 +2950,7 @@ const deserializeAws_json1_0RestoreTableFromBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3009,7 +3009,7 @@ const deserializeAws_json1_0RestoreTableToPointInTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3071,7 +3071,7 @@ const deserializeAws_json1_0ScanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3121,7 +3121,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3174,7 +3174,7 @@ const deserializeAws_json1_0TransactGetItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3230,7 +3230,7 @@ const deserializeAws_json1_0TransactWriteItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3289,7 +3289,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3342,7 +3342,7 @@ const deserializeAws_json1_0UpdateContinuousBackupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3392,7 +3392,7 @@ const deserializeAws_json1_0UpdateContributorInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3436,7 +3436,7 @@ const deserializeAws_json1_0UpdateGlobalTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3492,7 +3492,7 @@ const deserializeAws_json1_0UpdateGlobalTableSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3551,7 +3551,7 @@ const deserializeAws_json1_0UpdateItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3613,7 +3613,7 @@ const deserializeAws_json1_0UpdateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3666,7 +3666,7 @@ const deserializeAws_json1_0UpdateTableReplicaAutoScalingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3716,7 +3716,7 @@ const deserializeAws_json1_0UpdateTimeToLiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8522,6 +8522,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ebs/src/protocols/Aws_restJson1.ts b/clients/client-ebs/src/protocols/Aws_restJson1.ts index 23dd234c3b5c..e09e7386b619 100644 --- a/clients/client-ebs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ebs/src/protocols/Aws_restJson1.ts @@ -263,7 +263,7 @@ const deserializeAws_restJson1CompleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -323,7 +323,7 @@ const deserializeAws_restJson1GetSnapshotBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -391,7 +391,7 @@ const deserializeAws_restJson1ListChangedBlocksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -459,7 +459,7 @@ const deserializeAws_restJson1ListSnapshotBlocksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -514,7 +514,7 @@ const deserializeAws_restJson1PutSnapshotBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -597,7 +597,7 @@ const deserializeAws_restJson1StartSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -887,6 +887,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts index 87cd335aad56..9e584b915090 100644 --- a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts @@ -86,7 +86,7 @@ const deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -157,7 +157,7 @@ const deserializeAws_json1_1SendSSHPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -515,6 +515,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ec2/src/protocols/Aws_ec2.ts b/clients/client-ec2/src/protocols/Aws_ec2.ts index 065f865b2346..d2ef1f17bd4d 100644 --- a/clients/client-ec2/src/protocols/Aws_ec2.ts +++ b/clients/client-ec2/src/protocols/Aws_ec2.ts @@ -12233,7 +12233,7 @@ const deserializeAws_ec2AcceptReservedInstancesExchangeQuoteCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12268,7 +12268,7 @@ const deserializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12303,7 +12303,7 @@ const deserializeAws_ec2AcceptTransitGatewayPeeringAttachmentCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12338,7 +12338,7 @@ const deserializeAws_ec2AcceptTransitGatewayVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12373,7 +12373,7 @@ const deserializeAws_ec2AcceptVpcEndpointConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12408,7 +12408,7 @@ const deserializeAws_ec2AcceptVpcPeeringConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12443,7 +12443,7 @@ const deserializeAws_ec2AdvertiseByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12478,7 +12478,7 @@ const deserializeAws_ec2AllocateAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12513,7 +12513,7 @@ const deserializeAws_ec2AllocateHostsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12548,7 +12548,7 @@ const deserializeAws_ec2AllocateIpamPoolCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12583,7 +12583,7 @@ const deserializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12618,7 +12618,7 @@ const deserializeAws_ec2AssignIpv6AddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12653,7 +12653,7 @@ const deserializeAws_ec2AssignPrivateIpAddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12688,7 +12688,7 @@ const deserializeAws_ec2AssociateAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12723,7 +12723,7 @@ const deserializeAws_ec2AssociateClientVpnTargetNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12755,7 +12755,7 @@ const deserializeAws_ec2AssociateDhcpOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12790,7 +12790,7 @@ const deserializeAws_ec2AssociateEnclaveCertificateIamRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12825,7 +12825,7 @@ const deserializeAws_ec2AssociateIamInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12860,7 +12860,7 @@ const deserializeAws_ec2AssociateInstanceEventWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12895,7 +12895,7 @@ const deserializeAws_ec2AssociateRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12930,7 +12930,7 @@ const deserializeAws_ec2AssociateSubnetCidrBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12965,7 +12965,7 @@ const deserializeAws_ec2AssociateTransitGatewayMulticastDomainCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13000,7 +13000,7 @@ const deserializeAws_ec2AssociateTransitGatewayPolicyTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13035,7 +13035,7 @@ const deserializeAws_ec2AssociateTransitGatewayRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13070,7 +13070,7 @@ const deserializeAws_ec2AssociateTrunkInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13105,7 +13105,7 @@ const deserializeAws_ec2AssociateVpcCidrBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13140,7 +13140,7 @@ const deserializeAws_ec2AttachClassicLinkVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13172,7 +13172,7 @@ const deserializeAws_ec2AttachInternetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13207,7 +13207,7 @@ const deserializeAws_ec2AttachNetworkInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13242,7 +13242,7 @@ const deserializeAws_ec2AttachVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13277,7 +13277,7 @@ const deserializeAws_ec2AttachVpnGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13312,7 +13312,7 @@ const deserializeAws_ec2AuthorizeClientVpnIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13347,7 +13347,7 @@ const deserializeAws_ec2AuthorizeSecurityGroupEgressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13382,7 +13382,7 @@ const deserializeAws_ec2AuthorizeSecurityGroupIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13417,7 +13417,7 @@ const deserializeAws_ec2BundleInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13452,7 +13452,7 @@ const deserializeAws_ec2CancelBundleTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13487,7 +13487,7 @@ const deserializeAws_ec2CancelCapacityReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13522,7 +13522,7 @@ const deserializeAws_ec2CancelCapacityReservationFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13554,7 +13554,7 @@ const deserializeAws_ec2CancelConversionTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13586,7 +13586,7 @@ const deserializeAws_ec2CancelExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13621,7 +13621,7 @@ const deserializeAws_ec2CancelImportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13656,7 +13656,7 @@ const deserializeAws_ec2CancelReservedInstancesListingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13691,7 +13691,7 @@ const deserializeAws_ec2CancelSpotFleetRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13726,7 +13726,7 @@ const deserializeAws_ec2CancelSpotInstanceRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13761,7 +13761,7 @@ const deserializeAws_ec2ConfirmProductInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13796,7 +13796,7 @@ const deserializeAws_ec2CopyFpgaImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13831,7 +13831,7 @@ const deserializeAws_ec2CopyImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13866,7 +13866,7 @@ const deserializeAws_ec2CopySnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13901,7 +13901,7 @@ const deserializeAws_ec2CreateCapacityReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13936,7 +13936,7 @@ const deserializeAws_ec2CreateCapacityReservationFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13971,7 +13971,7 @@ const deserializeAws_ec2CreateCarrierGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14006,7 +14006,7 @@ const deserializeAws_ec2CreateClientVpnEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14041,7 +14041,7 @@ const deserializeAws_ec2CreateClientVpnRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14076,7 +14076,7 @@ const deserializeAws_ec2CreateCoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14111,7 +14111,7 @@ const deserializeAws_ec2CreateCoipPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14146,7 +14146,7 @@ const deserializeAws_ec2CreateCustomerGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14181,7 +14181,7 @@ const deserializeAws_ec2CreateDefaultSubnetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14216,7 +14216,7 @@ const deserializeAws_ec2CreateDefaultVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14251,7 +14251,7 @@ const deserializeAws_ec2CreateDhcpOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14286,7 +14286,7 @@ const deserializeAws_ec2CreateEgressOnlyInternetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14321,7 +14321,7 @@ const deserializeAws_ec2CreateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14356,7 +14356,7 @@ const deserializeAws_ec2CreateFlowLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14391,7 +14391,7 @@ const deserializeAws_ec2CreateFpgaImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14426,7 +14426,7 @@ const deserializeAws_ec2CreateImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14461,7 +14461,7 @@ const deserializeAws_ec2CreateInstanceEventWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14496,7 +14496,7 @@ const deserializeAws_ec2CreateInstanceExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14531,7 +14531,7 @@ const deserializeAws_ec2CreateInternetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14566,7 +14566,7 @@ const deserializeAws_ec2CreateIpamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14601,7 +14601,7 @@ const deserializeAws_ec2CreateIpamPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14636,7 +14636,7 @@ const deserializeAws_ec2CreateIpamScopeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14671,7 +14671,7 @@ const deserializeAws_ec2CreateKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14706,7 +14706,7 @@ const deserializeAws_ec2CreateLaunchTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14741,7 +14741,7 @@ const deserializeAws_ec2CreateLaunchTemplateVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14776,7 +14776,7 @@ const deserializeAws_ec2CreateLocalGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14811,7 +14811,7 @@ const deserializeAws_ec2CreateLocalGatewayRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14846,7 +14846,7 @@ const deserializeAws_ec2CreateLocalGatewayRouteTableVirtualInterfaceGroupAssocia ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14881,7 +14881,7 @@ const deserializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14916,7 +14916,7 @@ const deserializeAws_ec2CreateManagedPrefixListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14951,7 +14951,7 @@ const deserializeAws_ec2CreateNatGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14986,7 +14986,7 @@ const deserializeAws_ec2CreateNetworkAclCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15018,7 +15018,7 @@ const deserializeAws_ec2CreateNetworkAclEntryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15053,7 +15053,7 @@ const deserializeAws_ec2CreateNetworkInsightsAccessScopeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15088,7 +15088,7 @@ const deserializeAws_ec2CreateNetworkInsightsPathCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15123,7 +15123,7 @@ const deserializeAws_ec2CreateNetworkInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15158,7 +15158,7 @@ const deserializeAws_ec2CreateNetworkInterfacePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15193,7 +15193,7 @@ const deserializeAws_ec2CreatePlacementGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15228,7 +15228,7 @@ const deserializeAws_ec2CreatePublicIpv4PoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15263,7 +15263,7 @@ const deserializeAws_ec2CreateReplaceRootVolumeTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15298,7 +15298,7 @@ const deserializeAws_ec2CreateReservedInstancesListingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15333,7 +15333,7 @@ const deserializeAws_ec2CreateRestoreImageTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15368,7 +15368,7 @@ const deserializeAws_ec2CreateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15403,7 +15403,7 @@ const deserializeAws_ec2CreateRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15438,7 +15438,7 @@ const deserializeAws_ec2CreateSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15473,7 +15473,7 @@ const deserializeAws_ec2CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15508,7 +15508,7 @@ const deserializeAws_ec2CreateSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15543,7 +15543,7 @@ const deserializeAws_ec2CreateSpotDatafeedSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15578,7 +15578,7 @@ const deserializeAws_ec2CreateStoreImageTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15613,7 +15613,7 @@ const deserializeAws_ec2CreateSubnetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15648,7 +15648,7 @@ const deserializeAws_ec2CreateSubnetCidrReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15680,7 +15680,7 @@ const deserializeAws_ec2CreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15715,7 +15715,7 @@ const deserializeAws_ec2CreateTrafficMirrorFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15750,7 +15750,7 @@ const deserializeAws_ec2CreateTrafficMirrorFilterRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15785,7 +15785,7 @@ const deserializeAws_ec2CreateTrafficMirrorSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15820,7 +15820,7 @@ const deserializeAws_ec2CreateTrafficMirrorTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15855,7 +15855,7 @@ const deserializeAws_ec2CreateTransitGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15890,7 +15890,7 @@ const deserializeAws_ec2CreateTransitGatewayConnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15925,7 +15925,7 @@ const deserializeAws_ec2CreateTransitGatewayConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15960,7 +15960,7 @@ const deserializeAws_ec2CreateTransitGatewayMulticastDomainCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15995,7 +15995,7 @@ const deserializeAws_ec2CreateTransitGatewayPeeringAttachmentCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16030,7 +16030,7 @@ const deserializeAws_ec2CreateTransitGatewayPolicyTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16065,7 +16065,7 @@ const deserializeAws_ec2CreateTransitGatewayPrefixListReferenceCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16100,7 +16100,7 @@ const deserializeAws_ec2CreateTransitGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16135,7 +16135,7 @@ const deserializeAws_ec2CreateTransitGatewayRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16170,7 +16170,7 @@ const deserializeAws_ec2CreateTransitGatewayRouteTableAnnouncementCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16205,7 +16205,7 @@ const deserializeAws_ec2CreateTransitGatewayVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16240,7 +16240,7 @@ const deserializeAws_ec2CreateVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16275,7 +16275,7 @@ const deserializeAws_ec2CreateVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16310,7 +16310,7 @@ const deserializeAws_ec2CreateVpcEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16345,7 +16345,7 @@ const deserializeAws_ec2CreateVpcEndpointConnectionNotificationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16380,7 +16380,7 @@ const deserializeAws_ec2CreateVpcEndpointServiceConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16415,7 +16415,7 @@ const deserializeAws_ec2CreateVpcPeeringConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16450,7 +16450,7 @@ const deserializeAws_ec2CreateVpnConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16482,7 +16482,7 @@ const deserializeAws_ec2CreateVpnConnectionRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16517,7 +16517,7 @@ const deserializeAws_ec2CreateVpnGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16552,7 +16552,7 @@ const deserializeAws_ec2DeleteCarrierGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16587,7 +16587,7 @@ const deserializeAws_ec2DeleteClientVpnEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16622,7 +16622,7 @@ const deserializeAws_ec2DeleteClientVpnRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16657,7 +16657,7 @@ const deserializeAws_ec2DeleteCoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16692,7 +16692,7 @@ const deserializeAws_ec2DeleteCoipPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16724,7 +16724,7 @@ const deserializeAws_ec2DeleteCustomerGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16756,7 +16756,7 @@ const deserializeAws_ec2DeleteDhcpOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16791,7 +16791,7 @@ const deserializeAws_ec2DeleteEgressOnlyInternetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16826,7 +16826,7 @@ const deserializeAws_ec2DeleteFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16861,7 +16861,7 @@ const deserializeAws_ec2DeleteFlowLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16896,7 +16896,7 @@ const deserializeAws_ec2DeleteFpgaImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16931,7 +16931,7 @@ const deserializeAws_ec2DeleteInstanceEventWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16963,7 +16963,7 @@ const deserializeAws_ec2DeleteInternetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -16998,7 +16998,7 @@ const deserializeAws_ec2DeleteIpamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17033,7 +17033,7 @@ const deserializeAws_ec2DeleteIpamPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17068,7 +17068,7 @@ const deserializeAws_ec2DeleteIpamScopeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17100,7 +17100,7 @@ const deserializeAws_ec2DeleteKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17135,7 +17135,7 @@ const deserializeAws_ec2DeleteLaunchTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17170,7 +17170,7 @@ const deserializeAws_ec2DeleteLaunchTemplateVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17205,7 +17205,7 @@ const deserializeAws_ec2DeleteLocalGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17240,7 +17240,7 @@ const deserializeAws_ec2DeleteLocalGatewayRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17275,7 +17275,7 @@ const deserializeAws_ec2DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssocia ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17310,7 +17310,7 @@ const deserializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17345,7 +17345,7 @@ const deserializeAws_ec2DeleteManagedPrefixListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17380,7 +17380,7 @@ const deserializeAws_ec2DeleteNatGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17412,7 +17412,7 @@ const deserializeAws_ec2DeleteNetworkAclCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17444,7 +17444,7 @@ const deserializeAws_ec2DeleteNetworkAclEntryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17479,7 +17479,7 @@ const deserializeAws_ec2DeleteNetworkInsightsAccessScopeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17514,7 +17514,7 @@ const deserializeAws_ec2DeleteNetworkInsightsAccessScopeAnalysisCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17549,7 +17549,7 @@ const deserializeAws_ec2DeleteNetworkInsightsAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17584,7 +17584,7 @@ const deserializeAws_ec2DeleteNetworkInsightsPathCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17616,7 +17616,7 @@ const deserializeAws_ec2DeleteNetworkInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17651,7 +17651,7 @@ const deserializeAws_ec2DeleteNetworkInterfacePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17683,7 +17683,7 @@ const deserializeAws_ec2DeletePlacementGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17718,7 +17718,7 @@ const deserializeAws_ec2DeletePublicIpv4PoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17753,7 +17753,7 @@ const deserializeAws_ec2DeleteQueuedReservedInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17785,7 +17785,7 @@ const deserializeAws_ec2DeleteRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17817,7 +17817,7 @@ const deserializeAws_ec2DeleteRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17849,7 +17849,7 @@ const deserializeAws_ec2DeleteSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17881,7 +17881,7 @@ const deserializeAws_ec2DeleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17913,7 +17913,7 @@ const deserializeAws_ec2DeleteSpotDatafeedSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17945,7 +17945,7 @@ const deserializeAws_ec2DeleteSubnetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -17980,7 +17980,7 @@ const deserializeAws_ec2DeleteSubnetCidrReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18012,7 +18012,7 @@ const deserializeAws_ec2DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18047,7 +18047,7 @@ const deserializeAws_ec2DeleteTrafficMirrorFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18082,7 +18082,7 @@ const deserializeAws_ec2DeleteTrafficMirrorFilterRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18117,7 +18117,7 @@ const deserializeAws_ec2DeleteTrafficMirrorSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18152,7 +18152,7 @@ const deserializeAws_ec2DeleteTrafficMirrorTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18187,7 +18187,7 @@ const deserializeAws_ec2DeleteTransitGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18222,7 +18222,7 @@ const deserializeAws_ec2DeleteTransitGatewayConnectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18257,7 +18257,7 @@ const deserializeAws_ec2DeleteTransitGatewayConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18292,7 +18292,7 @@ const deserializeAws_ec2DeleteTransitGatewayMulticastDomainCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18327,7 +18327,7 @@ const deserializeAws_ec2DeleteTransitGatewayPeeringAttachmentCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18362,7 +18362,7 @@ const deserializeAws_ec2DeleteTransitGatewayPolicyTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18397,7 +18397,7 @@ const deserializeAws_ec2DeleteTransitGatewayPrefixListReferenceCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18432,7 +18432,7 @@ const deserializeAws_ec2DeleteTransitGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18467,7 +18467,7 @@ const deserializeAws_ec2DeleteTransitGatewayRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18502,7 +18502,7 @@ const deserializeAws_ec2DeleteTransitGatewayRouteTableAnnouncementCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18537,7 +18537,7 @@ const deserializeAws_ec2DeleteTransitGatewayVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18569,7 +18569,7 @@ const deserializeAws_ec2DeleteVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18601,7 +18601,7 @@ const deserializeAws_ec2DeleteVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18636,7 +18636,7 @@ const deserializeAws_ec2DeleteVpcEndpointConnectionNotificationsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18671,7 +18671,7 @@ const deserializeAws_ec2DeleteVpcEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18706,7 +18706,7 @@ const deserializeAws_ec2DeleteVpcEndpointServiceConfigurationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18741,7 +18741,7 @@ const deserializeAws_ec2DeleteVpcPeeringConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18773,7 +18773,7 @@ const deserializeAws_ec2DeleteVpnConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18805,7 +18805,7 @@ const deserializeAws_ec2DeleteVpnConnectionRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18837,7 +18837,7 @@ const deserializeAws_ec2DeleteVpnGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18872,7 +18872,7 @@ const deserializeAws_ec2DeprovisionByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18907,7 +18907,7 @@ const deserializeAws_ec2DeprovisionIpamPoolCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18942,7 +18942,7 @@ const deserializeAws_ec2DeprovisionPublicIpv4PoolCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -18974,7 +18974,7 @@ const deserializeAws_ec2DeregisterImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19009,7 +19009,7 @@ const deserializeAws_ec2DeregisterInstanceEventNotificationAttributesCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19044,7 +19044,7 @@ const deserializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19079,7 +19079,7 @@ const deserializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19114,7 +19114,7 @@ const deserializeAws_ec2DescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19149,7 +19149,7 @@ const deserializeAws_ec2DescribeAddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19184,7 +19184,7 @@ const deserializeAws_ec2DescribeAddressesAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19219,7 +19219,7 @@ const deserializeAws_ec2DescribeAggregateIdFormatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19254,7 +19254,7 @@ const deserializeAws_ec2DescribeAvailabilityZonesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19289,7 +19289,7 @@ const deserializeAws_ec2DescribeBundleTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19324,7 +19324,7 @@ const deserializeAws_ec2DescribeByoipCidrsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19359,7 +19359,7 @@ const deserializeAws_ec2DescribeCapacityReservationFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19394,7 +19394,7 @@ const deserializeAws_ec2DescribeCapacityReservationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19429,7 +19429,7 @@ const deserializeAws_ec2DescribeCarrierGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19464,7 +19464,7 @@ const deserializeAws_ec2DescribeClassicLinkInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19499,7 +19499,7 @@ const deserializeAws_ec2DescribeClientVpnAuthorizationRulesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19534,7 +19534,7 @@ const deserializeAws_ec2DescribeClientVpnConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19569,7 +19569,7 @@ const deserializeAws_ec2DescribeClientVpnEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19604,7 +19604,7 @@ const deserializeAws_ec2DescribeClientVpnRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19639,7 +19639,7 @@ const deserializeAws_ec2DescribeClientVpnTargetNetworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19674,7 +19674,7 @@ const deserializeAws_ec2DescribeCoipPoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19709,7 +19709,7 @@ const deserializeAws_ec2DescribeConversionTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19744,7 +19744,7 @@ const deserializeAws_ec2DescribeCustomerGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19779,7 +19779,7 @@ const deserializeAws_ec2DescribeDhcpOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19814,7 +19814,7 @@ const deserializeAws_ec2DescribeEgressOnlyInternetGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19849,7 +19849,7 @@ const deserializeAws_ec2DescribeElasticGpusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19884,7 +19884,7 @@ const deserializeAws_ec2DescribeExportImageTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19919,7 +19919,7 @@ const deserializeAws_ec2DescribeExportTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19954,7 +19954,7 @@ const deserializeAws_ec2DescribeFastLaunchImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -19989,7 +19989,7 @@ const deserializeAws_ec2DescribeFastSnapshotRestoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20024,7 +20024,7 @@ const deserializeAws_ec2DescribeFleetHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20059,7 +20059,7 @@ const deserializeAws_ec2DescribeFleetInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20094,7 +20094,7 @@ const deserializeAws_ec2DescribeFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20129,7 +20129,7 @@ const deserializeAws_ec2DescribeFlowLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20164,7 +20164,7 @@ const deserializeAws_ec2DescribeFpgaImageAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20199,7 +20199,7 @@ const deserializeAws_ec2DescribeFpgaImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20234,7 +20234,7 @@ const deserializeAws_ec2DescribeHostReservationOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20269,7 +20269,7 @@ const deserializeAws_ec2DescribeHostReservationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20304,7 +20304,7 @@ const deserializeAws_ec2DescribeHostsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20339,7 +20339,7 @@ const deserializeAws_ec2DescribeIamInstanceProfileAssociationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20374,7 +20374,7 @@ const deserializeAws_ec2DescribeIdentityIdFormatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20409,7 +20409,7 @@ const deserializeAws_ec2DescribeIdFormatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20444,7 +20444,7 @@ const deserializeAws_ec2DescribeImageAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20479,7 +20479,7 @@ const deserializeAws_ec2DescribeImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20514,7 +20514,7 @@ const deserializeAws_ec2DescribeImportImageTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20549,7 +20549,7 @@ const deserializeAws_ec2DescribeImportSnapshotTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20584,7 +20584,7 @@ const deserializeAws_ec2DescribeInstanceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20619,7 +20619,7 @@ const deserializeAws_ec2DescribeInstanceCreditSpecificationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20654,7 +20654,7 @@ const deserializeAws_ec2DescribeInstanceEventNotificationAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20689,7 +20689,7 @@ const deserializeAws_ec2DescribeInstanceEventWindowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20724,7 +20724,7 @@ const deserializeAws_ec2DescribeInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20759,7 +20759,7 @@ const deserializeAws_ec2DescribeInstanceStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20794,7 +20794,7 @@ const deserializeAws_ec2DescribeInstanceTypeOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20829,7 +20829,7 @@ const deserializeAws_ec2DescribeInstanceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20864,7 +20864,7 @@ const deserializeAws_ec2DescribeInternetGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20899,7 +20899,7 @@ const deserializeAws_ec2DescribeIpamPoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20934,7 +20934,7 @@ const deserializeAws_ec2DescribeIpamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -20969,7 +20969,7 @@ const deserializeAws_ec2DescribeIpamScopesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21004,7 +21004,7 @@ const deserializeAws_ec2DescribeIpv6PoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21039,7 +21039,7 @@ const deserializeAws_ec2DescribeKeyPairsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21074,7 +21074,7 @@ const deserializeAws_ec2DescribeLaunchTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21109,7 +21109,7 @@ const deserializeAws_ec2DescribeLaunchTemplateVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21144,7 +21144,7 @@ const deserializeAws_ec2DescribeLocalGatewayRouteTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21182,7 +21182,7 @@ const deserializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssoc ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21217,7 +21217,7 @@ const deserializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21252,7 +21252,7 @@ const deserializeAws_ec2DescribeLocalGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21287,7 +21287,7 @@ const deserializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21322,7 +21322,7 @@ const deserializeAws_ec2DescribeLocalGatewayVirtualInterfacesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21357,7 +21357,7 @@ const deserializeAws_ec2DescribeManagedPrefixListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21392,7 +21392,7 @@ const deserializeAws_ec2DescribeMovingAddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21427,7 +21427,7 @@ const deserializeAws_ec2DescribeNatGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21462,7 +21462,7 @@ const deserializeAws_ec2DescribeNetworkAclsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21497,7 +21497,7 @@ const deserializeAws_ec2DescribeNetworkInsightsAccessScopeAnalysesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21532,7 +21532,7 @@ const deserializeAws_ec2DescribeNetworkInsightsAccessScopesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21567,7 +21567,7 @@ const deserializeAws_ec2DescribeNetworkInsightsAnalysesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21602,7 +21602,7 @@ const deserializeAws_ec2DescribeNetworkInsightsPathsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21637,7 +21637,7 @@ const deserializeAws_ec2DescribeNetworkInterfaceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21672,7 +21672,7 @@ const deserializeAws_ec2DescribeNetworkInterfacePermissionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21707,7 +21707,7 @@ const deserializeAws_ec2DescribeNetworkInterfacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21742,7 +21742,7 @@ const deserializeAws_ec2DescribePlacementGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21777,7 +21777,7 @@ const deserializeAws_ec2DescribePrefixListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21812,7 +21812,7 @@ const deserializeAws_ec2DescribePrincipalIdFormatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21847,7 +21847,7 @@ const deserializeAws_ec2DescribePublicIpv4PoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21882,7 +21882,7 @@ const deserializeAws_ec2DescribeRegionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21917,7 +21917,7 @@ const deserializeAws_ec2DescribeReplaceRootVolumeTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21952,7 +21952,7 @@ const deserializeAws_ec2DescribeReservedInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -21987,7 +21987,7 @@ const deserializeAws_ec2DescribeReservedInstancesListingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22022,7 +22022,7 @@ const deserializeAws_ec2DescribeReservedInstancesModificationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22057,7 +22057,7 @@ const deserializeAws_ec2DescribeReservedInstancesOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22092,7 +22092,7 @@ const deserializeAws_ec2DescribeRouteTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22127,7 +22127,7 @@ const deserializeAws_ec2DescribeScheduledInstanceAvailabilityCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22162,7 +22162,7 @@ const deserializeAws_ec2DescribeScheduledInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22197,7 +22197,7 @@ const deserializeAws_ec2DescribeSecurityGroupReferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22232,7 +22232,7 @@ const deserializeAws_ec2DescribeSecurityGroupRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22267,7 +22267,7 @@ const deserializeAws_ec2DescribeSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22302,7 +22302,7 @@ const deserializeAws_ec2DescribeSnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22337,7 +22337,7 @@ const deserializeAws_ec2DescribeSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22372,7 +22372,7 @@ const deserializeAws_ec2DescribeSnapshotTierStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22407,7 +22407,7 @@ const deserializeAws_ec2DescribeSpotDatafeedSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22442,7 +22442,7 @@ const deserializeAws_ec2DescribeSpotFleetInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22477,7 +22477,7 @@ const deserializeAws_ec2DescribeSpotFleetRequestHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22512,7 +22512,7 @@ const deserializeAws_ec2DescribeSpotFleetRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22547,7 +22547,7 @@ const deserializeAws_ec2DescribeSpotInstanceRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22582,7 +22582,7 @@ const deserializeAws_ec2DescribeSpotPriceHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22617,7 +22617,7 @@ const deserializeAws_ec2DescribeStaleSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22652,7 +22652,7 @@ const deserializeAws_ec2DescribeStoreImageTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22687,7 +22687,7 @@ const deserializeAws_ec2DescribeSubnetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22722,7 +22722,7 @@ const deserializeAws_ec2DescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22757,7 +22757,7 @@ const deserializeAws_ec2DescribeTrafficMirrorFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22792,7 +22792,7 @@ const deserializeAws_ec2DescribeTrafficMirrorSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22827,7 +22827,7 @@ const deserializeAws_ec2DescribeTrafficMirrorTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22862,7 +22862,7 @@ const deserializeAws_ec2DescribeTransitGatewayAttachmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22897,7 +22897,7 @@ const deserializeAws_ec2DescribeTransitGatewayConnectPeersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22932,7 +22932,7 @@ const deserializeAws_ec2DescribeTransitGatewayConnectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -22967,7 +22967,7 @@ const deserializeAws_ec2DescribeTransitGatewayMulticastDomainsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23002,7 +23002,7 @@ const deserializeAws_ec2DescribeTransitGatewayPeeringAttachmentsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23037,7 +23037,7 @@ const deserializeAws_ec2DescribeTransitGatewayPolicyTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23072,7 +23072,7 @@ const deserializeAws_ec2DescribeTransitGatewayRouteTableAnnouncementsCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23107,7 +23107,7 @@ const deserializeAws_ec2DescribeTransitGatewayRouteTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23142,7 +23142,7 @@ const deserializeAws_ec2DescribeTransitGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23177,7 +23177,7 @@ const deserializeAws_ec2DescribeTransitGatewayVpcAttachmentsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23212,7 +23212,7 @@ const deserializeAws_ec2DescribeTrunkInterfaceAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23247,7 +23247,7 @@ const deserializeAws_ec2DescribeVolumeAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23282,7 +23282,7 @@ const deserializeAws_ec2DescribeVolumesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23317,7 +23317,7 @@ const deserializeAws_ec2DescribeVolumesModificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23352,7 +23352,7 @@ const deserializeAws_ec2DescribeVolumeStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23387,7 +23387,7 @@ const deserializeAws_ec2DescribeVpcAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23422,7 +23422,7 @@ const deserializeAws_ec2DescribeVpcClassicLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23457,7 +23457,7 @@ const deserializeAws_ec2DescribeVpcClassicLinkDnsSupportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23492,7 +23492,7 @@ const deserializeAws_ec2DescribeVpcEndpointConnectionNotificationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23527,7 +23527,7 @@ const deserializeAws_ec2DescribeVpcEndpointConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23562,7 +23562,7 @@ const deserializeAws_ec2DescribeVpcEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23597,7 +23597,7 @@ const deserializeAws_ec2DescribeVpcEndpointServiceConfigurationsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23632,7 +23632,7 @@ const deserializeAws_ec2DescribeVpcEndpointServicePermissionsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23667,7 +23667,7 @@ const deserializeAws_ec2DescribeVpcEndpointServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23702,7 +23702,7 @@ const deserializeAws_ec2DescribeVpcPeeringConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23737,7 +23737,7 @@ const deserializeAws_ec2DescribeVpcsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23772,7 +23772,7 @@ const deserializeAws_ec2DescribeVpnConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23807,7 +23807,7 @@ const deserializeAws_ec2DescribeVpnGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23842,7 +23842,7 @@ const deserializeAws_ec2DetachClassicLinkVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23874,7 +23874,7 @@ const deserializeAws_ec2DetachInternetGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23906,7 +23906,7 @@ const deserializeAws_ec2DetachNetworkInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23941,7 +23941,7 @@ const deserializeAws_ec2DetachVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -23973,7 +23973,7 @@ const deserializeAws_ec2DetachVpnGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24008,7 +24008,7 @@ const deserializeAws_ec2DisableEbsEncryptionByDefaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24043,7 +24043,7 @@ const deserializeAws_ec2DisableFastLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24078,7 +24078,7 @@ const deserializeAws_ec2DisableFastSnapshotRestoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24113,7 +24113,7 @@ const deserializeAws_ec2DisableImageDeprecationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24148,7 +24148,7 @@ const deserializeAws_ec2DisableIpamOrganizationAdminAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24183,7 +24183,7 @@ const deserializeAws_ec2DisableSerialConsoleAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24218,7 +24218,7 @@ const deserializeAws_ec2DisableTransitGatewayRouteTablePropagationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24250,7 +24250,7 @@ const deserializeAws_ec2DisableVgwRoutePropagationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24285,7 +24285,7 @@ const deserializeAws_ec2DisableVpcClassicLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24320,7 +24320,7 @@ const deserializeAws_ec2DisableVpcClassicLinkDnsSupportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24352,7 +24352,7 @@ const deserializeAws_ec2DisassociateAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24387,7 +24387,7 @@ const deserializeAws_ec2DisassociateClientVpnTargetNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24422,7 +24422,7 @@ const deserializeAws_ec2DisassociateEnclaveCertificateIamRoleCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24457,7 +24457,7 @@ const deserializeAws_ec2DisassociateIamInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24492,7 +24492,7 @@ const deserializeAws_ec2DisassociateInstanceEventWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24524,7 +24524,7 @@ const deserializeAws_ec2DisassociateRouteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24559,7 +24559,7 @@ const deserializeAws_ec2DisassociateSubnetCidrBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24594,7 +24594,7 @@ const deserializeAws_ec2DisassociateTransitGatewayMulticastDomainCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24629,7 +24629,7 @@ const deserializeAws_ec2DisassociateTransitGatewayPolicyTableCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24664,7 +24664,7 @@ const deserializeAws_ec2DisassociateTransitGatewayRouteTableCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24699,7 +24699,7 @@ const deserializeAws_ec2DisassociateTrunkInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24734,7 +24734,7 @@ const deserializeAws_ec2DisassociateVpcCidrBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24769,7 +24769,7 @@ const deserializeAws_ec2EnableEbsEncryptionByDefaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24804,7 +24804,7 @@ const deserializeAws_ec2EnableFastLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24839,7 +24839,7 @@ const deserializeAws_ec2EnableFastSnapshotRestoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24874,7 +24874,7 @@ const deserializeAws_ec2EnableImageDeprecationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24909,7 +24909,7 @@ const deserializeAws_ec2EnableIpamOrganizationAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24944,7 +24944,7 @@ const deserializeAws_ec2EnableSerialConsoleAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -24979,7 +24979,7 @@ const deserializeAws_ec2EnableTransitGatewayRouteTablePropagationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25011,7 +25011,7 @@ const deserializeAws_ec2EnableVgwRoutePropagationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25043,7 +25043,7 @@ const deserializeAws_ec2EnableVolumeIOCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25078,7 +25078,7 @@ const deserializeAws_ec2EnableVpcClassicLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25113,7 +25113,7 @@ const deserializeAws_ec2EnableVpcClassicLinkDnsSupportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25148,7 +25148,7 @@ const deserializeAws_ec2ExportClientVpnClientCertificateRevocationListCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25183,7 +25183,7 @@ const deserializeAws_ec2ExportClientVpnClientConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25218,7 +25218,7 @@ const deserializeAws_ec2ExportImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25253,7 +25253,7 @@ const deserializeAws_ec2ExportTransitGatewayRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25288,7 +25288,7 @@ const deserializeAws_ec2GetAssociatedEnclaveCertificateIamRolesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25323,7 +25323,7 @@ const deserializeAws_ec2GetAssociatedIpv6PoolCidrsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25358,7 +25358,7 @@ const deserializeAws_ec2GetCapacityReservationUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25393,7 +25393,7 @@ const deserializeAws_ec2GetCoipPoolUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25428,7 +25428,7 @@ const deserializeAws_ec2GetConsoleOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25463,7 +25463,7 @@ const deserializeAws_ec2GetConsoleScreenshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25498,7 +25498,7 @@ const deserializeAws_ec2GetDefaultCreditSpecificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25533,7 +25533,7 @@ const deserializeAws_ec2GetEbsDefaultKmsKeyIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25568,7 +25568,7 @@ const deserializeAws_ec2GetEbsEncryptionByDefaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25603,7 +25603,7 @@ const deserializeAws_ec2GetFlowLogsIntegrationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25638,7 +25638,7 @@ const deserializeAws_ec2GetGroupsForCapacityReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25673,7 +25673,7 @@ const deserializeAws_ec2GetHostReservationPurchasePreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25708,7 +25708,7 @@ const deserializeAws_ec2GetInstanceTypesFromInstanceRequirementsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25743,7 +25743,7 @@ const deserializeAws_ec2GetInstanceUefiDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25778,7 +25778,7 @@ const deserializeAws_ec2GetIpamAddressHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25813,7 +25813,7 @@ const deserializeAws_ec2GetIpamPoolAllocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25848,7 +25848,7 @@ const deserializeAws_ec2GetIpamPoolCidrsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25883,7 +25883,7 @@ const deserializeAws_ec2GetIpamResourceCidrsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25918,7 +25918,7 @@ const deserializeAws_ec2GetLaunchTemplateDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25953,7 +25953,7 @@ const deserializeAws_ec2GetManagedPrefixListAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -25988,7 +25988,7 @@ const deserializeAws_ec2GetManagedPrefixListEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26023,7 +26023,7 @@ const deserializeAws_ec2GetNetworkInsightsAccessScopeAnalysisFindingsCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26058,7 +26058,7 @@ const deserializeAws_ec2GetNetworkInsightsAccessScopeContentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26093,7 +26093,7 @@ const deserializeAws_ec2GetPasswordDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26128,7 +26128,7 @@ const deserializeAws_ec2GetReservedInstancesExchangeQuoteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26163,7 +26163,7 @@ const deserializeAws_ec2GetSerialConsoleAccessStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26198,7 +26198,7 @@ const deserializeAws_ec2GetSpotPlacementScoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26233,7 +26233,7 @@ const deserializeAws_ec2GetSubnetCidrReservationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26268,7 +26268,7 @@ const deserializeAws_ec2GetTransitGatewayAttachmentPropagationsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26303,7 +26303,7 @@ const deserializeAws_ec2GetTransitGatewayMulticastDomainAssociationsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26338,7 +26338,7 @@ const deserializeAws_ec2GetTransitGatewayPolicyTableAssociationsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26373,7 +26373,7 @@ const deserializeAws_ec2GetTransitGatewayPolicyTableEntriesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26408,7 +26408,7 @@ const deserializeAws_ec2GetTransitGatewayPrefixListReferencesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26443,7 +26443,7 @@ const deserializeAws_ec2GetTransitGatewayRouteTableAssociationsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26478,7 +26478,7 @@ const deserializeAws_ec2GetTransitGatewayRouteTablePropagationsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26513,7 +26513,7 @@ const deserializeAws_ec2GetVpnConnectionDeviceSampleConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26548,7 +26548,7 @@ const deserializeAws_ec2GetVpnConnectionDeviceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26583,7 +26583,7 @@ const deserializeAws_ec2ImportClientVpnClientCertificateRevocationListCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26618,7 +26618,7 @@ const deserializeAws_ec2ImportImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26653,7 +26653,7 @@ const deserializeAws_ec2ImportInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26688,7 +26688,7 @@ const deserializeAws_ec2ImportKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26723,7 +26723,7 @@ const deserializeAws_ec2ImportSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26758,7 +26758,7 @@ const deserializeAws_ec2ImportVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26793,7 +26793,7 @@ const deserializeAws_ec2ListImagesInRecycleBinCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26828,7 +26828,7 @@ const deserializeAws_ec2ListSnapshotsInRecycleBinCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26863,7 +26863,7 @@ const deserializeAws_ec2ModifyAddressAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26898,7 +26898,7 @@ const deserializeAws_ec2ModifyAvailabilityZoneGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26933,7 +26933,7 @@ const deserializeAws_ec2ModifyCapacityReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -26968,7 +26968,7 @@ const deserializeAws_ec2ModifyCapacityReservationFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27003,7 +27003,7 @@ const deserializeAws_ec2ModifyClientVpnEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27038,7 +27038,7 @@ const deserializeAws_ec2ModifyDefaultCreditSpecificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27073,7 +27073,7 @@ const deserializeAws_ec2ModifyEbsDefaultKmsKeyIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27108,7 +27108,7 @@ const deserializeAws_ec2ModifyFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27143,7 +27143,7 @@ const deserializeAws_ec2ModifyFpgaImageAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27178,7 +27178,7 @@ const deserializeAws_ec2ModifyHostsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27210,7 +27210,7 @@ const deserializeAws_ec2ModifyIdentityIdFormatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27242,7 +27242,7 @@ const deserializeAws_ec2ModifyIdFormatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27274,7 +27274,7 @@ const deserializeAws_ec2ModifyImageAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27306,7 +27306,7 @@ const deserializeAws_ec2ModifyInstanceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27341,7 +27341,7 @@ const deserializeAws_ec2ModifyInstanceCapacityReservationAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27376,7 +27376,7 @@ const deserializeAws_ec2ModifyInstanceCreditSpecificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27411,7 +27411,7 @@ const deserializeAws_ec2ModifyInstanceEventStartTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27446,7 +27446,7 @@ const deserializeAws_ec2ModifyInstanceEventWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27481,7 +27481,7 @@ const deserializeAws_ec2ModifyInstanceMaintenanceOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27516,7 +27516,7 @@ const deserializeAws_ec2ModifyInstanceMetadataOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27551,7 +27551,7 @@ const deserializeAws_ec2ModifyInstancePlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27586,7 +27586,7 @@ const deserializeAws_ec2ModifyIpamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27621,7 +27621,7 @@ const deserializeAws_ec2ModifyIpamPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27656,7 +27656,7 @@ const deserializeAws_ec2ModifyIpamResourceCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27691,7 +27691,7 @@ const deserializeAws_ec2ModifyIpamScopeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27726,7 +27726,7 @@ const deserializeAws_ec2ModifyLaunchTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27761,7 +27761,7 @@ const deserializeAws_ec2ModifyLocalGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27796,7 +27796,7 @@ const deserializeAws_ec2ModifyManagedPrefixListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27828,7 +27828,7 @@ const deserializeAws_ec2ModifyNetworkInterfaceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27863,7 +27863,7 @@ const deserializeAws_ec2ModifyPrivateDnsNameOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27898,7 +27898,7 @@ const deserializeAws_ec2ModifyReservedInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27933,7 +27933,7 @@ const deserializeAws_ec2ModifySecurityGroupRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -27965,7 +27965,7 @@ const deserializeAws_ec2ModifySnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28000,7 +28000,7 @@ const deserializeAws_ec2ModifySnapshotTierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28035,7 +28035,7 @@ const deserializeAws_ec2ModifySpotFleetRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28067,7 +28067,7 @@ const deserializeAws_ec2ModifySubnetAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28102,7 +28102,7 @@ const deserializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28137,7 +28137,7 @@ const deserializeAws_ec2ModifyTrafficMirrorFilterRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28172,7 +28172,7 @@ const deserializeAws_ec2ModifyTrafficMirrorSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28207,7 +28207,7 @@ const deserializeAws_ec2ModifyTransitGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28242,7 +28242,7 @@ const deserializeAws_ec2ModifyTransitGatewayPrefixListReferenceCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28277,7 +28277,7 @@ const deserializeAws_ec2ModifyTransitGatewayVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28312,7 +28312,7 @@ const deserializeAws_ec2ModifyVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28344,7 +28344,7 @@ const deserializeAws_ec2ModifyVolumeAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28376,7 +28376,7 @@ const deserializeAws_ec2ModifyVpcAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28411,7 +28411,7 @@ const deserializeAws_ec2ModifyVpcEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28446,7 +28446,7 @@ const deserializeAws_ec2ModifyVpcEndpointConnectionNotificationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28481,7 +28481,7 @@ const deserializeAws_ec2ModifyVpcEndpointServiceConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28516,7 +28516,7 @@ const deserializeAws_ec2ModifyVpcEndpointServicePayerResponsibilityCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28551,7 +28551,7 @@ const deserializeAws_ec2ModifyVpcEndpointServicePermissionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28586,7 +28586,7 @@ const deserializeAws_ec2ModifyVpcPeeringConnectionOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28621,7 +28621,7 @@ const deserializeAws_ec2ModifyVpcTenancyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28656,7 +28656,7 @@ const deserializeAws_ec2ModifyVpnConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28691,7 +28691,7 @@ const deserializeAws_ec2ModifyVpnConnectionOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28726,7 +28726,7 @@ const deserializeAws_ec2ModifyVpnTunnelCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28761,7 +28761,7 @@ const deserializeAws_ec2ModifyVpnTunnelOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28796,7 +28796,7 @@ const deserializeAws_ec2MonitorInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28831,7 +28831,7 @@ const deserializeAws_ec2MoveAddressToVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28866,7 +28866,7 @@ const deserializeAws_ec2MoveByoipCidrToIpamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28901,7 +28901,7 @@ const deserializeAws_ec2ProvisionByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28936,7 +28936,7 @@ const deserializeAws_ec2ProvisionIpamPoolCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -28971,7 +28971,7 @@ const deserializeAws_ec2ProvisionPublicIpv4PoolCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29006,7 +29006,7 @@ const deserializeAws_ec2PurchaseHostReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29041,7 +29041,7 @@ const deserializeAws_ec2PurchaseReservedInstancesOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29076,7 +29076,7 @@ const deserializeAws_ec2PurchaseScheduledInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29108,7 +29108,7 @@ const deserializeAws_ec2RebootInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29143,7 +29143,7 @@ const deserializeAws_ec2RegisterImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29178,7 +29178,7 @@ const deserializeAws_ec2RegisterInstanceEventNotificationAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29213,7 +29213,7 @@ const deserializeAws_ec2RegisterTransitGatewayMulticastGroupMembersCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29248,7 +29248,7 @@ const deserializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29283,7 +29283,7 @@ const deserializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29318,7 +29318,7 @@ const deserializeAws_ec2RejectTransitGatewayPeeringAttachmentCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29353,7 +29353,7 @@ const deserializeAws_ec2RejectTransitGatewayVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29388,7 +29388,7 @@ const deserializeAws_ec2RejectVpcEndpointConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29423,7 +29423,7 @@ const deserializeAws_ec2RejectVpcPeeringConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29455,7 +29455,7 @@ const deserializeAws_ec2ReleaseAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29490,7 +29490,7 @@ const deserializeAws_ec2ReleaseHostsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29525,7 +29525,7 @@ const deserializeAws_ec2ReleaseIpamPoolAllocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29560,7 +29560,7 @@ const deserializeAws_ec2ReplaceIamInstanceProfileAssociationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29595,7 +29595,7 @@ const deserializeAws_ec2ReplaceNetworkAclAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29627,7 +29627,7 @@ const deserializeAws_ec2ReplaceNetworkAclEntryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29659,7 +29659,7 @@ const deserializeAws_ec2ReplaceRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29694,7 +29694,7 @@ const deserializeAws_ec2ReplaceRouteTableAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29729,7 +29729,7 @@ const deserializeAws_ec2ReplaceTransitGatewayRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29761,7 +29761,7 @@ const deserializeAws_ec2ReportInstanceStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29796,7 +29796,7 @@ const deserializeAws_ec2RequestSpotFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29831,7 +29831,7 @@ const deserializeAws_ec2RequestSpotInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29866,7 +29866,7 @@ const deserializeAws_ec2ResetAddressAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29901,7 +29901,7 @@ const deserializeAws_ec2ResetEbsDefaultKmsKeyIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29936,7 +29936,7 @@ const deserializeAws_ec2ResetFpgaImageAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -29968,7 +29968,7 @@ const deserializeAws_ec2ResetImageAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30000,7 +30000,7 @@ const deserializeAws_ec2ResetInstanceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30032,7 +30032,7 @@ const deserializeAws_ec2ResetNetworkInterfaceAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30064,7 +30064,7 @@ const deserializeAws_ec2ResetSnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30099,7 +30099,7 @@ const deserializeAws_ec2RestoreAddressToClassicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30134,7 +30134,7 @@ const deserializeAws_ec2RestoreImageFromRecycleBinCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30169,7 +30169,7 @@ const deserializeAws_ec2RestoreManagedPrefixListVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30204,7 +30204,7 @@ const deserializeAws_ec2RestoreSnapshotFromRecycleBinCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30239,7 +30239,7 @@ const deserializeAws_ec2RestoreSnapshotTierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30274,7 +30274,7 @@ const deserializeAws_ec2RevokeClientVpnIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30309,7 +30309,7 @@ const deserializeAws_ec2RevokeSecurityGroupEgressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30344,7 +30344,7 @@ const deserializeAws_ec2RevokeSecurityGroupIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30379,7 +30379,7 @@ const deserializeAws_ec2RunInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30414,7 +30414,7 @@ const deserializeAws_ec2RunScheduledInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30449,7 +30449,7 @@ const deserializeAws_ec2SearchLocalGatewayRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30484,7 +30484,7 @@ const deserializeAws_ec2SearchTransitGatewayMulticastGroupsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30519,7 +30519,7 @@ const deserializeAws_ec2SearchTransitGatewayRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30551,7 +30551,7 @@ const deserializeAws_ec2SendDiagnosticInterruptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30586,7 +30586,7 @@ const deserializeAws_ec2StartInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30621,7 +30621,7 @@ const deserializeAws_ec2StartNetworkInsightsAccessScopeAnalysisCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30656,7 +30656,7 @@ const deserializeAws_ec2StartNetworkInsightsAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30691,7 +30691,7 @@ const deserializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30726,7 +30726,7 @@ const deserializeAws_ec2StopInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30761,7 +30761,7 @@ const deserializeAws_ec2TerminateClientVpnConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30796,7 +30796,7 @@ const deserializeAws_ec2TerminateInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30831,7 +30831,7 @@ const deserializeAws_ec2UnassignIpv6AddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30863,7 +30863,7 @@ const deserializeAws_ec2UnassignPrivateIpAddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30898,7 +30898,7 @@ const deserializeAws_ec2UnmonitorInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30933,7 +30933,7 @@ const deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -30968,7 +30968,7 @@ const deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -31003,7 +31003,7 @@ const deserializeAws_ec2WithdrawByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -80346,6 +80346,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts index c4938a51ddec..4c666560985b 100644 --- a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts @@ -490,7 +490,7 @@ const deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -540,7 +540,7 @@ const deserializeAws_json1_1BatchDeleteImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -587,7 +587,7 @@ const deserializeAws_json1_1CompleteLayerUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -655,7 +655,7 @@ const deserializeAws_json1_1CreateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -711,7 +711,7 @@ const deserializeAws_json1_1DeleteRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -761,7 +761,7 @@ const deserializeAws_json1_1DeleteRepositoryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -811,7 +811,7 @@ const deserializeAws_json1_1DescribeImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -861,7 +861,7 @@ const deserializeAws_json1_1DescribeImageTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -908,7 +908,7 @@ const deserializeAws_json1_1DescribeRegistriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -955,7 +955,7 @@ const deserializeAws_json1_1DescribeRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1002,7 +1002,7 @@ const deserializeAws_json1_1GetAuthorizationTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1046,7 +1046,7 @@ const deserializeAws_json1_1GetRegistryCatalogDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1090,7 +1090,7 @@ const deserializeAws_json1_1GetRepositoryCatalogDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_json1_1GetRepositoryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1187,7 +1187,7 @@ const deserializeAws_json1_1InitiateLayerUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1240,7 +1240,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1287,7 +1287,7 @@ const deserializeAws_json1_1PutImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1358,7 +1358,7 @@ const deserializeAws_json1_1PutRegistryCatalogDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1405,7 +1405,7 @@ const deserializeAws_json1_1PutRepositoryCatalogDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1452,7 +1452,7 @@ const deserializeAws_json1_1SetRepositoryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1499,7 +1499,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1552,7 +1552,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1605,7 +1605,7 @@ const deserializeAws_json1_1UploadLayerPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3048,6 +3048,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 98490ddbab49..fc6690ae007f 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -856,7 +856,7 @@ const deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -903,7 +903,7 @@ const deserializeAws_json1_1BatchDeleteImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -950,7 +950,7 @@ const deserializeAws_json1_1BatchGetImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -997,7 +997,7 @@ const deserializeAws_json1_1BatchGetRepositoryScanningConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1047,7 +1047,7 @@ const deserializeAws_json1_1CompleteLayerUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1112,7 +1112,7 @@ const deserializeAws_json1_1CreatePullThroughCacheRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1168,7 +1168,7 @@ const deserializeAws_json1_1CreateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1227,7 +1227,7 @@ const deserializeAws_json1_1DeleteLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1277,7 +1277,7 @@ const deserializeAws_json1_1DeletePullThroughCacheRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1327,7 +1327,7 @@ const deserializeAws_json1_1DeleteRegistryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1377,7 +1377,7 @@ const deserializeAws_json1_1DeleteRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1430,7 +1430,7 @@ const deserializeAws_json1_1DeleteRepositoryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1480,7 +1480,7 @@ const deserializeAws_json1_1DescribeImageReplicationStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1533,7 +1533,7 @@ const deserializeAws_json1_1DescribeImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1583,7 +1583,7 @@ const deserializeAws_json1_1DescribeImageScanFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1639,7 +1639,7 @@ const deserializeAws_json1_1DescribePullThroughCacheRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1689,7 +1689,7 @@ const deserializeAws_json1_1DescribeRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1736,7 +1736,7 @@ const deserializeAws_json1_1DescribeRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1783,7 +1783,7 @@ const deserializeAws_json1_1GetAuthorizationTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1827,7 +1827,7 @@ const deserializeAws_json1_1GetDownloadUrlForLayerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1880,7 +1880,7 @@ const deserializeAws_json1_1GetLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1930,7 +1930,7 @@ const deserializeAws_json1_1GetLifecyclePolicyPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1980,7 +1980,7 @@ const deserializeAws_json1_1GetRegistryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_json1_1GetRegistryScanningConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2077,7 +2077,7 @@ const deserializeAws_json1_1GetRepositoryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2127,7 +2127,7 @@ const deserializeAws_json1_1InitiateLayerUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2177,7 +2177,7 @@ const deserializeAws_json1_1ListImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2224,7 +2224,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2271,7 +2271,7 @@ const deserializeAws_json1_1PutImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2339,7 +2339,7 @@ const deserializeAws_json1_1PutImageScanningConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2389,7 +2389,7 @@ const deserializeAws_json1_1PutImageTagMutabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2436,7 +2436,7 @@ const deserializeAws_json1_1PutLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2483,7 +2483,7 @@ const deserializeAws_json1_1PutRegistryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2530,7 +2530,7 @@ const deserializeAws_json1_1PutRegistryScanningConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2577,7 +2577,7 @@ const deserializeAws_json1_1PutReplicationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2624,7 +2624,7 @@ const deserializeAws_json1_1SetRepositoryPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2671,7 +2671,7 @@ const deserializeAws_json1_1StartImageScanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2730,7 +2730,7 @@ const deserializeAws_json1_1StartLifecyclePolicyPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2783,7 +2783,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2889,7 +2889,7 @@ const deserializeAws_json1_1UploadLayerPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5722,6 +5722,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ecs/src/protocols/Aws_json1_1.ts b/clients/client-ecs/src/protocols/Aws_json1_1.ts index d042bf3b74a9..6868c27bdcba 100644 --- a/clients/client-ecs/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/src/protocols/Aws_json1_1.ts @@ -1070,7 +1070,7 @@ const deserializeAws_json1_1CreateCapacityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1123,7 +1123,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1170,7 +1170,7 @@ const deserializeAws_json1_1CreateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1232,7 +1232,7 @@ const deserializeAws_json1_1CreateTaskSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1300,7 +1300,7 @@ const deserializeAws_json1_1DeleteAccountSettingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1347,7 +1347,7 @@ const deserializeAws_json1_1DeleteAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1394,7 +1394,7 @@ const deserializeAws_json1_1DeleteCapacityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1441,7 +1441,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1503,7 +1503,7 @@ const deserializeAws_json1_1DeleteServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1556,7 +1556,7 @@ const deserializeAws_json1_1DeleteTaskSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1621,7 +1621,7 @@ const deserializeAws_json1_1DeregisterContainerInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1671,7 +1671,7 @@ const deserializeAws_json1_1DeregisterTaskDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1718,7 +1718,7 @@ const deserializeAws_json1_1DescribeCapacityProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1765,7 +1765,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1812,7 +1812,7 @@ const deserializeAws_json1_1DescribeContainerInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1862,7 +1862,7 @@ const deserializeAws_json1_1DescribeServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1912,7 +1912,7 @@ const deserializeAws_json1_1DescribeTaskDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1959,7 +1959,7 @@ const deserializeAws_json1_1DescribeTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2009,7 +2009,7 @@ const deserializeAws_json1_1DescribeTaskSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2071,7 +2071,7 @@ const deserializeAws_json1_1DiscoverPollEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2115,7 +2115,7 @@ const deserializeAws_json1_1ExecuteCommandCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2171,7 +2171,7 @@ const deserializeAws_json1_1ListAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2218,7 +2218,7 @@ const deserializeAws_json1_1ListAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2262,7 +2262,7 @@ const deserializeAws_json1_1ListClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2309,7 +2309,7 @@ const deserializeAws_json1_1ListContainerInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2359,7 +2359,7 @@ const deserializeAws_json1_1ListServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2409,7 +2409,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2459,7 +2459,7 @@ const deserializeAws_json1_1ListTaskDefinitionFamiliesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2506,7 +2506,7 @@ const deserializeAws_json1_1ListTaskDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2553,7 +2553,7 @@ const deserializeAws_json1_1ListTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2606,7 +2606,7 @@ const deserializeAws_json1_1PutAccountSettingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2653,7 +2653,7 @@ const deserializeAws_json1_1PutAccountSettingDefaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2700,7 +2700,7 @@ const deserializeAws_json1_1PutAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2750,7 +2750,7 @@ const deserializeAws_json1_1PutClusterCapacityProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2806,7 +2806,7 @@ const deserializeAws_json1_1RegisterContainerInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2853,7 +2853,7 @@ const deserializeAws_json1_1RegisterTaskDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2900,7 +2900,7 @@ const deserializeAws_json1_1RunTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2965,7 +2965,7 @@ const deserializeAws_json1_1StartTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3015,7 +3015,7 @@ const deserializeAws_json1_1StopTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3065,7 +3065,7 @@ const deserializeAws_json1_1SubmitAttachmentStateChangesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3115,7 +3115,7 @@ const deserializeAws_json1_1SubmitContainerStateChangeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3162,7 +3162,7 @@ const deserializeAws_json1_1SubmitTaskStateChangeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3212,7 +3212,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3265,7 +3265,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3318,7 +3318,7 @@ const deserializeAws_json1_1UpdateCapacityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3365,7 +3365,7 @@ const deserializeAws_json1_1UpdateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3415,7 +3415,7 @@ const deserializeAws_json1_1UpdateClusterSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3465,7 +3465,7 @@ const deserializeAws_json1_1UpdateContainerAgentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3524,7 +3524,7 @@ const deserializeAws_json1_1UpdateContainerInstancesStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3574,7 +3574,7 @@ const deserializeAws_json1_1UpdateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3639,7 +3639,7 @@ const deserializeAws_json1_1UpdateServicePrimaryTaskSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3704,7 +3704,7 @@ const deserializeAws_json1_1UpdateTaskSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8354,6 +8354,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-efs/src/protocols/Aws_restJson1.ts b/clients/client-efs/src/protocols/Aws_restJson1.ts index 8bb0f5f02680..16f693c3c304 100644 --- a/clients/client-efs/src/protocols/Aws_restJson1.ts +++ b/clients/client-efs/src/protocols/Aws_restJson1.ts @@ -1111,7 +1111,7 @@ const deserializeAws_restJson1CreateAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1218,7 +1218,7 @@ const deserializeAws_restJson1CreateFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1304,7 +1304,7 @@ const deserializeAws_restJson1CreateMountTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1396,7 +1396,7 @@ const deserializeAws_restJson1CreateReplicationConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1461,7 +1461,7 @@ const deserializeAws_restJson1CreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1505,7 +1505,7 @@ const deserializeAws_restJson1DeleteAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1549,7 +1549,7 @@ const deserializeAws_restJson1DeleteFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1596,7 +1596,7 @@ const deserializeAws_restJson1DeleteFileSystemPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1643,7 +1643,7 @@ const deserializeAws_restJson1DeleteMountTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1690,7 +1690,7 @@ const deserializeAws_restJson1DeleteReplicationConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1737,7 +1737,7 @@ const deserializeAws_restJson1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1787,7 +1787,7 @@ const deserializeAws_restJson1DescribeAccessPointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1DescribeAccountPreferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1881,7 +1881,7 @@ const deserializeAws_restJson1DescribeBackupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1937,7 +1937,7 @@ const deserializeAws_restJson1DescribeFileSystemPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1993,7 +1993,7 @@ const deserializeAws_restJson1DescribeFileSystemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2040,7 +2040,7 @@ const deserializeAws_restJson1DescribeLifecycleConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2093,7 +2093,7 @@ const deserializeAws_restJson1DescribeMountTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2146,7 +2146,7 @@ const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2199,7 +2199,7 @@ const deserializeAws_restJson1DescribeReplicationConfigurationsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2258,7 +2258,7 @@ const deserializeAws_restJson1DescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2308,7 +2308,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2355,7 +2355,7 @@ const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2411,7 +2411,7 @@ const deserializeAws_restJson1PutAccountPreferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2455,7 +2455,7 @@ const deserializeAws_restJson1PutBackupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2511,7 +2511,7 @@ const deserializeAws_restJson1PutFileSystemPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2564,7 +2564,7 @@ const deserializeAws_restJson1PutLifecycleConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2611,7 +2611,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2658,7 +2658,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2756,7 +2756,7 @@ const deserializeAws_restJson1UpdateFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3795,6 +3795,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-eks/src/protocols/Aws_restJson1.ts b/clients/client-eks/src/protocols/Aws_restJson1.ts index 718824c0a720..1bd75967ed33 100644 --- a/clients/client-eks/src/protocols/Aws_restJson1.ts +++ b/clients/client-eks/src/protocols/Aws_restJson1.ts @@ -1175,7 +1175,7 @@ const deserializeAws_restJson1AssociateEncryptionConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1234,7 +1234,7 @@ const deserializeAws_restJson1AssociateIdentityProviderConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1290,7 +1290,7 @@ const deserializeAws_restJson1CreateAddonCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1346,7 +1346,7 @@ const deserializeAws_restJson1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1405,7 +1405,7 @@ const deserializeAws_restJson1CreateFargateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1461,7 +1461,7 @@ const deserializeAws_restJson1CreateNodegroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1520,7 +1520,7 @@ const deserializeAws_restJson1DeleteAddonCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1573,7 +1573,7 @@ const deserializeAws_restJson1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1626,7 +1626,7 @@ const deserializeAws_restJson1DeleteFargateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1676,7 +1676,7 @@ const deserializeAws_restJson1DeleteNodegroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1732,7 +1732,7 @@ const deserializeAws_restJson1DeregisterClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1788,7 +1788,7 @@ const deserializeAws_restJson1DescribeAddonCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1844,7 +1844,7 @@ const deserializeAws_restJson1DescribeAddonVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1891,7 +1891,7 @@ const deserializeAws_restJson1DescribeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1941,7 +1941,7 @@ const deserializeAws_restJson1DescribeFargateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1994,7 +1994,7 @@ const deserializeAws_restJson1DescribeIdentityProviderConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2047,7 +2047,7 @@ const deserializeAws_restJson1DescribeNodegroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2100,7 +2100,7 @@ const deserializeAws_restJson1DescribeUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2150,7 +2150,7 @@ const deserializeAws_restJson1DisassociateIdentityProviderConfigCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2209,7 +2209,7 @@ const deserializeAws_restJson1ListAddonsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2265,7 +2265,7 @@ const deserializeAws_restJson1ListClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2318,7 +2318,7 @@ const deserializeAws_restJson1ListFargateProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2374,7 +2374,7 @@ const deserializeAws_restJson1ListIdentityProviderConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2430,7 +2430,7 @@ const deserializeAws_restJson1ListNodegroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2483,7 +2483,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2530,7 +2530,7 @@ const deserializeAws_restJson1ListUpdatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2580,7 +2580,7 @@ const deserializeAws_restJson1RegisterClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2639,7 +2639,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2680,7 +2680,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2724,7 +2724,7 @@ const deserializeAws_restJson1UpdateAddonCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2780,7 +2780,7 @@ const deserializeAws_restJson1UpdateClusterConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_restJson1UpdateClusterVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2892,7 +2892,7 @@ const deserializeAws_restJson1UpdateNodegroupConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2948,7 +2948,7 @@ const deserializeAws_restJson1UpdateNodegroupVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4254,6 +4254,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts index c804254e4f76..02628207b652 100644 --- a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts +++ b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts @@ -1104,7 +1104,7 @@ const deserializeAws_queryAbortEnvironmentUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1145,7 +1145,7 @@ const deserializeAws_queryApplyEnvironmentManagedActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1186,7 +1186,7 @@ const deserializeAws_queryAssociateEnvironmentOperationsRoleCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1227,7 +1227,7 @@ const deserializeAws_queryCheckDNSAvailabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1262,7 +1262,7 @@ const deserializeAws_queryComposeEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1306,7 +1306,7 @@ const deserializeAws_queryCreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1347,7 +1347,7 @@ const deserializeAws_queryCreateApplicationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1400,7 +1400,7 @@ const deserializeAws_queryCreateConfigurationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1447,7 +1447,7 @@ const deserializeAws_queryCreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1491,7 +1491,7 @@ const deserializeAws_queryCreatePlatformVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_queryCreateStorageLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1582,7 +1582,7 @@ const deserializeAws_queryDeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1620,7 +1620,7 @@ const deserializeAws_queryDeleteApplicationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1667,7 +1667,7 @@ const deserializeAws_queryDeleteConfigurationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_queryDeleteEnvironmentConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1740,7 +1740,7 @@ const deserializeAws_queryDeletePlatformVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1790,7 +1790,7 @@ const deserializeAws_queryDescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1831,7 +1831,7 @@ const deserializeAws_queryDescribeApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1866,7 +1866,7 @@ const deserializeAws_queryDescribeApplicationVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1901,7 +1901,7 @@ const deserializeAws_queryDescribeConfigurationOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1942,7 +1942,7 @@ const deserializeAws_queryDescribeConfigurationSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1983,7 +1983,7 @@ const deserializeAws_queryDescribeEnvironmentHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_queryDescribeEnvironmentManagedActionHistoryCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2074,7 +2074,7 @@ const deserializeAws_queryDescribeEnvironmentManagedActionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2118,7 +2118,7 @@ const deserializeAws_queryDescribeEnvironmentResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2159,7 +2159,7 @@ const deserializeAws_queryDescribeEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2194,7 +2194,7 @@ const deserializeAws_queryDescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2229,7 +2229,7 @@ const deserializeAws_queryDescribeInstancesHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2273,7 +2273,7 @@ const deserializeAws_queryDescribePlatformVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2314,7 +2314,7 @@ const deserializeAws_queryDisassociateEnvironmentOperationsRoleCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2358,7 +2358,7 @@ const deserializeAws_queryListAvailableSolutionStacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2393,7 +2393,7 @@ const deserializeAws_queryListPlatformBranchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2428,7 +2428,7 @@ const deserializeAws_queryListPlatformVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2472,7 +2472,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2516,7 +2516,7 @@ const deserializeAws_queryRebuildEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2554,7 +2554,7 @@ const deserializeAws_queryRequestEnvironmentInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2586,7 +2586,7 @@ const deserializeAws_queryRestartAppServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2621,7 +2621,7 @@ const deserializeAws_queryRetrieveEnvironmentInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2653,7 +2653,7 @@ const deserializeAws_querySwapEnvironmentCNAMEsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2688,7 +2688,7 @@ const deserializeAws_queryTerminateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2729,7 +2729,7 @@ const deserializeAws_queryUpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2767,7 +2767,7 @@ const deserializeAws_queryUpdateApplicationResourceLifecycleCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2808,7 +2808,7 @@ const deserializeAws_queryUpdateApplicationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2843,7 +2843,7 @@ const deserializeAws_queryUpdateConfigurationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2887,7 +2887,7 @@ const deserializeAws_queryUpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2928,7 +2928,7 @@ const deserializeAws_queryUpdateTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2984,7 +2984,7 @@ const deserializeAws_queryValidateConfigurationSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7297,6 +7297,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts index 09bcac4a4d04..b2eab303475e 100644 --- a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts @@ -224,7 +224,7 @@ const deserializeAws_restJson1DescribeAcceleratorOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -274,7 +274,7 @@ const deserializeAws_restJson1DescribeAcceleratorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -321,7 +321,7 @@ const deserializeAws_restJson1DescribeAcceleratorTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -362,7 +362,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -406,7 +406,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -450,7 +450,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -734,6 +734,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts index 7a388687dc19..2bdac89e908d 100644 --- a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts @@ -805,7 +805,7 @@ const deserializeAws_queryAddListenerCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -852,7 +852,7 @@ const deserializeAws_queryAddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -908,7 +908,7 @@ const deserializeAws_queryCreateListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1000,7 +1000,7 @@ const deserializeAws_queryCreateLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1077,7 +1077,7 @@ const deserializeAws_queryCreateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1160,7 +1160,7 @@ const deserializeAws_queryCreateTargetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1210,7 +1210,7 @@ const deserializeAws_queryDeleteListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1254,7 +1254,7 @@ const deserializeAws_queryDeleteLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1301,7 +1301,7 @@ const deserializeAws_queryDeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1345,7 +1345,7 @@ const deserializeAws_queryDeleteTargetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1386,7 +1386,7 @@ const deserializeAws_queryDeregisterTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1430,7 +1430,7 @@ const deserializeAws_queryDescribeAccountLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1465,7 +1465,7 @@ const deserializeAws_queryDescribeListenerCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1506,7 +1506,7 @@ const deserializeAws_queryDescribeListenersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1556,7 +1556,7 @@ const deserializeAws_queryDescribeLoadBalancerAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1597,7 +1597,7 @@ const deserializeAws_queryDescribeLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1638,7 +1638,7 @@ const deserializeAws_queryDescribeRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1685,7 +1685,7 @@ const deserializeAws_queryDescribeSSLPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1726,7 +1726,7 @@ const deserializeAws_queryDescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1776,7 +1776,7 @@ const deserializeAws_queryDescribeTargetGroupAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1817,7 +1817,7 @@ const deserializeAws_queryDescribeTargetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1861,7 +1861,7 @@ const deserializeAws_queryDescribeTargetHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1908,7 +1908,7 @@ const deserializeAws_queryModifyListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1997,7 +1997,7 @@ const deserializeAws_queryModifyLoadBalancerAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2041,7 +2041,7 @@ const deserializeAws_queryModifyRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2112,7 +2112,7 @@ const deserializeAws_queryModifyTargetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2156,7 +2156,7 @@ const deserializeAws_queryModifyTargetGroupAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2200,7 +2200,7 @@ const deserializeAws_queryRegisterTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2250,7 +2250,7 @@ const deserializeAws_queryRemoveListenerCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2294,7 +2294,7 @@ const deserializeAws_queryRemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2347,7 +2347,7 @@ const deserializeAws_querySetIpAddressTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2394,7 +2394,7 @@ const deserializeAws_querySetRulePrioritiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2441,7 +2441,7 @@ const deserializeAws_querySetSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2488,7 +2488,7 @@ const deserializeAws_querySetSubnetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6721,6 +6721,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts index 140caef81e39..4a40a3b6c471 100644 --- a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts @@ -720,7 +720,7 @@ const deserializeAws_queryAddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -770,7 +770,7 @@ const deserializeAws_queryApplySecurityGroupsToLoadBalancerCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -817,7 +817,7 @@ const deserializeAws_queryAttachLoadBalancerToSubnetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -867,7 +867,7 @@ const deserializeAws_queryConfigureHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -911,7 +911,7 @@ const deserializeAws_queryCreateAppCookieStickinessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -964,7 +964,7 @@ const deserializeAws_queryCreateLBCookieStickinessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1014,7 +1014,7 @@ const deserializeAws_queryCreateLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1088,7 +1088,7 @@ const deserializeAws_queryCreateLoadBalancerListenersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1141,7 +1141,7 @@ const deserializeAws_queryCreateLoadBalancerPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1194,7 +1194,7 @@ const deserializeAws_queryDeleteLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1229,7 +1229,7 @@ const deserializeAws_queryDeleteLoadBalancerListenersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1270,7 +1270,7 @@ const deserializeAws_queryDeleteLoadBalancerPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1314,7 +1314,7 @@ const deserializeAws_queryDeregisterInstancesFromLoadBalancerCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1358,7 +1358,7 @@ const deserializeAws_queryDescribeAccountLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1393,7 +1393,7 @@ const deserializeAws_queryDescribeInstanceHealthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1440,7 +1440,7 @@ const deserializeAws_queryDescribeLoadBalancerAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1484,7 +1484,7 @@ const deserializeAws_queryDescribeLoadBalancerPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_queryDescribeLoadBalancerPolicyTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1572,7 +1572,7 @@ const deserializeAws_queryDescribeLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1616,7 +1616,7 @@ const deserializeAws_queryDescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1657,7 +1657,7 @@ const deserializeAws_queryDetachLoadBalancerFromSubnetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1704,7 +1704,7 @@ const deserializeAws_queryDisableAvailabilityZonesForLoadBalancerCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1748,7 +1748,7 @@ const deserializeAws_queryEnableAvailabilityZonesForLoadBalancerCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1789,7 +1789,7 @@ const deserializeAws_queryModifyLoadBalancerAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1836,7 +1836,7 @@ const deserializeAws_queryRegisterInstancesWithLoadBalancerCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1880,7 +1880,7 @@ const deserializeAws_queryRemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1924,7 +1924,7 @@ const deserializeAws_querySetLoadBalancerListenerSSLCertificateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1980,7 +1980,7 @@ const deserializeAws_querySetLoadBalancerPoliciesForBackendServerCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_querySetLoadBalancerPoliciesOfListenerCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4675,6 +4675,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts index fc0c4a9e1b19..fcb9fb7ce2ae 100644 --- a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts @@ -543,7 +543,7 @@ const deserializeAws_restJson1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -599,7 +599,7 @@ const deserializeAws_restJson1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -658,7 +658,7 @@ const deserializeAws_restJson1CreatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -717,7 +717,7 @@ const deserializeAws_restJson1CreatePresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -767,7 +767,7 @@ const deserializeAws_restJson1DeletePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -820,7 +820,7 @@ const deserializeAws_restJson1DeletePresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -876,7 +876,7 @@ const deserializeAws_restJson1ListJobsByPipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -932,7 +932,7 @@ const deserializeAws_restJson1ListJobsByStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -988,7 +988,7 @@ const deserializeAws_restJson1ListPipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1041,7 +1041,7 @@ const deserializeAws_restJson1ListPresetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1091,7 +1091,7 @@ const deserializeAws_restJson1ReadJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1147,7 +1147,7 @@ const deserializeAws_restJson1ReadPipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_restJson1ReadPresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1256,7 +1256,7 @@ const deserializeAws_restJson1TestRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1312,7 +1312,7 @@ const deserializeAws_restJson1UpdatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1368,7 +1368,7 @@ const deserializeAws_restJson1UpdatePipelineNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1424,7 +1424,7 @@ const deserializeAws_restJson1UpdatePipelineStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2584,6 +2584,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-elasticache/src/protocols/Aws_query.ts b/clients/client-elasticache/src/protocols/Aws_query.ts index ee246c98ca56..9100dfa56456 100644 --- a/clients/client-elasticache/src/protocols/Aws_query.ts +++ b/clients/client-elasticache/src/protocols/Aws_query.ts @@ -1535,7 +1535,7 @@ const deserializeAws_queryAddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1612,7 +1612,7 @@ const deserializeAws_queryAuthorizeCacheSecurityGroupIngressCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1665,7 +1665,7 @@ const deserializeAws_queryBatchApplyUpdateActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1709,7 +1709,7 @@ const deserializeAws_queryBatchStopUpdateActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1753,7 +1753,7 @@ const deserializeAws_queryCompleteMigrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1800,7 +1800,7 @@ const deserializeAws_queryCopySnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1859,7 +1859,7 @@ const deserializeAws_queryCreateCacheClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1939,7 +1939,7 @@ const deserializeAws_queryCreateCacheParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1995,7 +1995,7 @@ const deserializeAws_queryCreateCacheSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2048,7 +2048,7 @@ const deserializeAws_queryCreateCacheSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2104,7 +2104,7 @@ const deserializeAws_queryCreateGlobalReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2157,7 +2157,7 @@ const deserializeAws_queryCreateReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2252,7 +2252,7 @@ const deserializeAws_queryCreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2320,7 +2320,7 @@ const deserializeAws_queryCreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2379,7 +2379,7 @@ const deserializeAws_queryCreateUserGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2444,7 +2444,7 @@ const deserializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2494,7 +2494,7 @@ const deserializeAws_queryDecreaseReplicaCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2568,7 +2568,7 @@ const deserializeAws_queryDeleteCacheClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2624,7 +2624,7 @@ const deserializeAws_queryDeleteCacheParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2671,7 +2671,7 @@ const deserializeAws_queryDeleteCacheSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2718,7 +2718,7 @@ const deserializeAws_queryDeleteCacheSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2762,7 +2762,7 @@ const deserializeAws_queryDeleteGlobalReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2809,7 +2809,7 @@ const deserializeAws_queryDeleteReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2868,7 +2868,7 @@ const deserializeAws_queryDeleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2918,7 +2918,7 @@ const deserializeAws_queryDeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2971,7 +2971,7 @@ const deserializeAws_queryDeleteUserGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_queryDescribeCacheClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3068,7 +3068,7 @@ const deserializeAws_queryDescribeCacheEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3103,7 +3103,7 @@ const deserializeAws_queryDescribeCacheParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3150,7 +3150,7 @@ const deserializeAws_queryDescribeCacheParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3197,7 +3197,7 @@ const deserializeAws_queryDescribeCacheSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3244,7 +3244,7 @@ const deserializeAws_queryDescribeCacheSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3288,7 +3288,7 @@ const deserializeAws_queryDescribeEngineDefaultParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3332,7 +3332,7 @@ const deserializeAws_queryDescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3379,7 +3379,7 @@ const deserializeAws_queryDescribeGlobalReplicationGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3426,7 +3426,7 @@ const deserializeAws_queryDescribeReplicationGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3473,7 +3473,7 @@ const deserializeAws_queryDescribeReservedCacheNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3523,7 +3523,7 @@ const deserializeAws_queryDescribeReservedCacheNodesOfferingsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3570,7 +3570,7 @@ const deserializeAws_queryDescribeServiceUpdatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3617,7 +3617,7 @@ const deserializeAws_queryDescribeSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3667,7 +3667,7 @@ const deserializeAws_queryDescribeUpdateActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3711,7 +3711,7 @@ const deserializeAws_queryDescribeUserGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3758,7 +3758,7 @@ const deserializeAws_queryDescribeUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3808,7 +3808,7 @@ const deserializeAws_queryDisassociateGlobalReplicationGroupCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3861,7 +3861,7 @@ const deserializeAws_queryFailoverGlobalReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3914,7 +3914,7 @@ const deserializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3961,7 +3961,7 @@ const deserializeAws_queryIncreaseReplicaCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4038,7 +4038,7 @@ const deserializeAws_queryListAllowedNodeTypeModificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4088,7 +4088,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4159,7 +4159,7 @@ const deserializeAws_queryModifyCacheClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4230,7 +4230,7 @@ const deserializeAws_queryModifyCacheParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4283,7 +4283,7 @@ const deserializeAws_queryModifyCacheSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4336,7 +4336,7 @@ const deserializeAws_queryModifyGlobalReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4383,7 +4383,7 @@ const deserializeAws_queryModifyReplicationGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4472,7 +4472,7 @@ const deserializeAws_queryModifyReplicationGroupShardConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4540,7 +4540,7 @@ const deserializeAws_queryModifyUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4593,7 +4593,7 @@ const deserializeAws_queryModifyUserGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4658,7 +4658,7 @@ const deserializeAws_queryPurchaseReservedCacheNodesOfferingCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4717,7 +4717,7 @@ const deserializeAws_queryRebalanceSlotsInGlobalReplicationGroupCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4764,7 +4764,7 @@ const deserializeAws_queryRebootCacheClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4808,7 +4808,7 @@ const deserializeAws_queryRemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4882,7 +4882,7 @@ const deserializeAws_queryResetCacheParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4938,7 +4938,7 @@ const deserializeAws_queryRevokeCacheSecurityGroupIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4991,7 +4991,7 @@ const deserializeAws_queryStartMigrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5041,7 +5041,7 @@ const deserializeAws_queryTestFailoverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12516,6 +12516,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts index 97bbb519fb22..37768d57fc07 100644 --- a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts @@ -1434,7 +1434,7 @@ const deserializeAws_restJson1AcceptInboundCrossClusterSearchConnectionCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_restJson1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_restJson1AssociatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1587,7 +1587,7 @@ const deserializeAws_restJson1CancelElasticsearchServiceSoftwareUpdateCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1637,7 +1637,7 @@ const deserializeAws_restJson1CreateElasticsearchDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1711,7 +1711,7 @@ const deserializeAws_restJson1CreateOutboundCrossClusterSearchConnectionCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1761,7 +1761,7 @@ const deserializeAws_restJson1CreatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1820,7 +1820,7 @@ const deserializeAws_restJson1DeleteElasticsearchDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1867,7 +1867,7 @@ const deserializeAws_restJson1DeleteElasticsearchServiceRoleCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1917,7 +1917,7 @@ const deserializeAws_restJson1DeleteInboundCrossClusterSearchConnectionCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1964,7 +1964,7 @@ const deserializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2008,7 +2008,7 @@ const deserializeAws_restJson1DeletePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2067,7 +2067,7 @@ const deserializeAws_restJson1DescribeDomainAutoTunesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2120,7 +2120,7 @@ const deserializeAws_restJson1DescribeDomainChangeProgressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2170,7 +2170,7 @@ const deserializeAws_restJson1DescribeElasticsearchDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2220,7 +2220,7 @@ const deserializeAws_restJson1DescribeElasticsearchDomainConfigCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2270,7 +2270,7 @@ const deserializeAws_restJson1DescribeElasticsearchDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2317,7 +2317,7 @@ const deserializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2379,7 +2379,7 @@ const deserializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1DescribeOutboundCrossClusterSearchConnectionsComma ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2476,7 +2476,7 @@ const deserializeAws_restJson1DescribePackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2535,7 +2535,7 @@ const deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsComm ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2591,7 +2591,7 @@ const deserializeAws_restJson1DescribeReservedElasticsearchInstancesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2641,7 +2641,7 @@ const deserializeAws_restJson1DissociatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2700,7 +2700,7 @@ const deserializeAws_restJson1GetCompatibleElasticsearchVersionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2762,7 +2762,7 @@ const deserializeAws_restJson1GetPackageVersionHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2818,7 +2818,7 @@ const deserializeAws_restJson1GetUpgradeHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2877,7 +2877,7 @@ const deserializeAws_restJson1GetUpgradeStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2930,7 +2930,7 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2980,7 +2980,7 @@ const deserializeAws_restJson1ListDomainsForPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3039,7 +3039,7 @@ const deserializeAws_restJson1ListElasticsearchInstanceTypesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3095,7 +3095,7 @@ const deserializeAws_restJson1ListElasticsearchVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3151,7 +3151,7 @@ const deserializeAws_restJson1ListPackagesForDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3204,7 +3204,7 @@ const deserializeAws_restJson1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3257,7 +3257,7 @@ const deserializeAws_restJson1PurchaseReservedElasticsearchInstanceOfferingComma ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3316,7 +3316,7 @@ const deserializeAws_restJson1RejectInboundCrossClusterSearchConnectionCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3357,7 +3357,7 @@ const deserializeAws_restJson1RemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3407,7 +3407,7 @@ const deserializeAws_restJson1StartElasticsearchServiceSoftwareUpdateCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3460,7 +3460,7 @@ const deserializeAws_restJson1UpdateElasticsearchDomainConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3516,7 +3516,7 @@ const deserializeAws_restJson1UpdatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3581,7 +3581,7 @@ const deserializeAws_restJson1UpgradeElasticsearchDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5388,6 +5388,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts index 706370617a40..2c0f62cd66ac 100644 --- a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts @@ -575,7 +575,7 @@ const deserializeAws_restJson1CancelJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -628,7 +628,7 @@ const deserializeAws_restJson1CreateManagedEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -681,7 +681,7 @@ const deserializeAws_restJson1CreateVirtualClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -731,7 +731,7 @@ const deserializeAws_restJson1DeleteManagedEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -775,7 +775,7 @@ const deserializeAws_restJson1DeleteVirtualClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -819,7 +819,7 @@ const deserializeAws_restJson1DescribeJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -866,7 +866,7 @@ const deserializeAws_restJson1DescribeManagedEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -913,7 +913,7 @@ const deserializeAws_restJson1DescribeVirtualClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -963,7 +963,7 @@ const deserializeAws_restJson1ListJobRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1010,7 +1010,7 @@ const deserializeAws_restJson1ListManagedEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1054,7 +1054,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1104,7 +1104,7 @@ const deserializeAws_restJson1ListVirtualClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1157,7 +1157,7 @@ const deserializeAws_restJson1StartJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1201,7 +1201,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1245,7 +1245,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1798,6 +1798,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts index 56f12788e3ae..039f07bc34ca 100644 --- a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts @@ -541,7 +541,7 @@ const deserializeAws_restJson1CancelJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -594,7 +594,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -638,7 +638,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -685,7 +685,7 @@ const deserializeAws_restJson1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -732,7 +732,7 @@ const deserializeAws_restJson1GetJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -782,7 +782,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -829,7 +829,7 @@ const deserializeAws_restJson1ListJobRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -873,7 +873,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -917,7 +917,7 @@ const deserializeAws_restJson1StartApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -973,7 +973,7 @@ const deserializeAws_restJson1StartJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1020,7 +1020,7 @@ const deserializeAws_restJson1StopApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1064,7 +1064,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1108,7 +1108,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1155,7 +1155,7 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1891,6 +1891,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-emr/src/protocols/Aws_json1_1.ts b/clients/client-emr/src/protocols/Aws_json1_1.ts index aa7425001cad..850fb08cc6ec 100644 --- a/clients/client-emr/src/protocols/Aws_json1_1.ts +++ b/clients/client-emr/src/protocols/Aws_json1_1.ts @@ -1055,7 +1055,7 @@ const deserializeAws_json1_1AddInstanceFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1099,7 +1099,7 @@ const deserializeAws_json1_1AddInstanceGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1140,7 +1140,7 @@ const deserializeAws_json1_1AddJobFlowStepsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1181,7 +1181,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1225,7 +1225,7 @@ const deserializeAws_json1_1CancelStepsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1269,7 +1269,7 @@ const deserializeAws_json1_1CreateSecurityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1313,7 +1313,7 @@ const deserializeAws_json1_1CreateStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1354,7 +1354,7 @@ const deserializeAws_json1_1CreateStudioSessionMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1398,7 +1398,7 @@ const deserializeAws_json1_1DeleteSecurityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1439,7 +1439,7 @@ const deserializeAws_json1_1DeleteStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1480,7 +1480,7 @@ const deserializeAws_json1_1DeleteStudioSessionMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1524,7 +1524,7 @@ const deserializeAws_json1_1DescribeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1568,7 +1568,7 @@ const deserializeAws_json1_1DescribeJobFlowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1609,7 +1609,7 @@ const deserializeAws_json1_1DescribeNotebookExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1653,7 +1653,7 @@ const deserializeAws_json1_1DescribeReleaseLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1697,7 +1697,7 @@ const deserializeAws_json1_1DescribeSecurityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1741,7 +1741,7 @@ const deserializeAws_json1_1DescribeStepCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1785,7 +1785,7 @@ const deserializeAws_json1_1DescribeStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1829,7 +1829,7 @@ const deserializeAws_json1_1GetAutoTerminationPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1864,7 +1864,7 @@ const deserializeAws_json1_1GetBlockPublicAccessConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1908,7 +1908,7 @@ const deserializeAws_json1_1GetManagedScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1943,7 +1943,7 @@ const deserializeAws_json1_1GetStudioSessionMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1ListBootstrapActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2031,7 +2031,7 @@ const deserializeAws_json1_1ListClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2075,7 +2075,7 @@ const deserializeAws_json1_1ListInstanceFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2119,7 +2119,7 @@ const deserializeAws_json1_1ListInstanceGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2163,7 +2163,7 @@ const deserializeAws_json1_1ListInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2207,7 +2207,7 @@ const deserializeAws_json1_1ListNotebookExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2251,7 +2251,7 @@ const deserializeAws_json1_1ListReleaseLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2295,7 +2295,7 @@ const deserializeAws_json1_1ListSecurityConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2339,7 +2339,7 @@ const deserializeAws_json1_1ListStepsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2383,7 +2383,7 @@ const deserializeAws_json1_1ListStudiosCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2427,7 +2427,7 @@ const deserializeAws_json1_1ListStudioSessionMappingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2471,7 +2471,7 @@ const deserializeAws_json1_1ModifyClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2512,7 +2512,7 @@ const deserializeAws_json1_1ModifyInstanceFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2553,7 +2553,7 @@ const deserializeAws_json1_1ModifyInstanceGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2594,7 +2594,7 @@ const deserializeAws_json1_1PutAutoScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2629,7 +2629,7 @@ const deserializeAws_json1_1PutAutoTerminationPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2664,7 +2664,7 @@ const deserializeAws_json1_1PutBlockPublicAccessConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2708,7 +2708,7 @@ const deserializeAws_json1_1PutManagedScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2743,7 +2743,7 @@ const deserializeAws_json1_1RemoveAutoScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2778,7 +2778,7 @@ const deserializeAws_json1_1RemoveAutoTerminationPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2813,7 +2813,7 @@ const deserializeAws_json1_1RemoveManagedScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2848,7 +2848,7 @@ const deserializeAws_json1_1RemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2892,7 +2892,7 @@ const deserializeAws_json1_1RunJobFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2930,7 +2930,7 @@ const deserializeAws_json1_1SetTerminationProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2968,7 +2968,7 @@ const deserializeAws_json1_1SetVisibleToAllUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3009,7 +3009,7 @@ const deserializeAws_json1_1StartNotebookExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3050,7 +3050,7 @@ const deserializeAws_json1_1StopNotebookExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3091,7 +3091,7 @@ const deserializeAws_json1_1TerminateJobFlowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3129,7 +3129,7 @@ const deserializeAws_json1_1UpdateStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3170,7 +3170,7 @@ const deserializeAws_json1_1UpdateStudioSessionMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6584,6 +6584,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts index 27d4cc8ff3bc..b638b9955cc3 100644 --- a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts @@ -1053,7 +1053,7 @@ const deserializeAws_json1_1ActivateEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1106,7 +1106,7 @@ const deserializeAws_json1_1CancelReplayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1156,7 +1156,7 @@ const deserializeAws_json1_1CreateApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1206,7 +1206,7 @@ const deserializeAws_json1_1CreateArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1262,7 +1262,7 @@ const deserializeAws_json1_1CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1309,7 +1309,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1356,7 +1356,7 @@ const deserializeAws_json1_1CreateEventBusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1415,7 +1415,7 @@ const deserializeAws_json1_1CreatePartnerEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1465,7 +1465,7 @@ const deserializeAws_json1_1DeactivateEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1518,7 +1518,7 @@ const deserializeAws_json1_1DeauthorizeConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1565,7 +1565,7 @@ const deserializeAws_json1_1DeleteApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1612,7 +1612,7 @@ const deserializeAws_json1_1DeleteArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1659,7 +1659,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1706,7 +1706,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1750,7 +1750,7 @@ const deserializeAws_json1_1DeleteEventBusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1791,7 +1791,7 @@ const deserializeAws_json1_1DeletePartnerEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1835,7 +1835,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1885,7 +1885,7 @@ const deserializeAws_json1_1DescribeApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1929,7 +1929,7 @@ const deserializeAws_json1_1DescribeArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1976,7 +1976,7 @@ const deserializeAws_json1_1DescribeConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2020,7 +2020,7 @@ const deserializeAws_json1_1DescribeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2064,7 +2064,7 @@ const deserializeAws_json1_1DescribeEventBusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2108,7 +2108,7 @@ const deserializeAws_json1_1DescribeEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2155,7 +2155,7 @@ const deserializeAws_json1_1DescribePartnerEventSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2202,7 +2202,7 @@ const deserializeAws_json1_1DescribeReplayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2246,7 +2246,7 @@ const deserializeAws_json1_1DescribeRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2287,7 +2287,7 @@ const deserializeAws_json1_1DisableRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2334,7 +2334,7 @@ const deserializeAws_json1_1EnableRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,7 +2384,7 @@ const deserializeAws_json1_1ListApiDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2425,7 +2425,7 @@ const deserializeAws_json1_1ListArchivesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2469,7 +2469,7 @@ const deserializeAws_json1_1ListConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2510,7 +2510,7 @@ const deserializeAws_json1_1ListEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2551,7 +2551,7 @@ const deserializeAws_json1_1ListEventBusesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2592,7 +2592,7 @@ const deserializeAws_json1_1ListEventSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2636,7 +2636,7 @@ const deserializeAws_json1_1ListPartnerEventSourceAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2683,7 +2683,7 @@ const deserializeAws_json1_1ListPartnerEventSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2727,7 +2727,7 @@ const deserializeAws_json1_1ListReplaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2768,7 +2768,7 @@ const deserializeAws_json1_1ListRuleNamesByTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2812,7 +2812,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2856,7 +2856,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2900,7 +2900,7 @@ const deserializeAws_json1_1ListTargetsByRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2944,7 +2944,7 @@ const deserializeAws_json1_1PutEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2985,7 +2985,7 @@ const deserializeAws_json1_1PutPartnerEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3026,7 +3026,7 @@ const deserializeAws_json1_1PutPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3079,7 +3079,7 @@ const deserializeAws_json1_1PutRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3135,7 +3135,7 @@ const deserializeAws_json1_1PutTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3185,7 +3185,7 @@ const deserializeAws_json1_1RemovePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3235,7 +3235,7 @@ const deserializeAws_json1_1RemoveTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3285,7 +3285,7 @@ const deserializeAws_json1_1StartReplayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3338,7 +3338,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3388,7 +3388,7 @@ const deserializeAws_json1_1TestEventPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3432,7 +3432,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3482,7 +3482,7 @@ const deserializeAws_json1_1UpdateApiDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3532,7 +3532,7 @@ const deserializeAws_json1_1UpdateArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3585,7 +3585,7 @@ const deserializeAws_json1_1UpdateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3635,7 +3635,7 @@ const deserializeAws_json1_1UpdateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6885,6 +6885,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-evidently/src/protocols/Aws_restJson1.ts b/clients/client-evidently/src/protocols/Aws_restJson1.ts index c061d21a1ce8..370930074b46 100644 --- a/clients/client-evidently/src/protocols/Aws_restJson1.ts +++ b/clients/client-evidently/src/protocols/Aws_restJson1.ts @@ -1226,7 +1226,7 @@ const deserializeAws_restJson1BatchEvaluateFeatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1276,7 +1276,7 @@ const deserializeAws_restJson1CreateExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1329,7 +1329,7 @@ const deserializeAws_restJson1CreateFeatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1382,7 +1382,7 @@ const deserializeAws_restJson1CreateLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1435,7 +1435,7 @@ const deserializeAws_restJson1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1485,7 +1485,7 @@ const deserializeAws_restJson1CreateSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1532,7 +1532,7 @@ const deserializeAws_restJson1DeleteExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1585,7 +1585,7 @@ const deserializeAws_restJson1DeleteFeatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1635,7 +1635,7 @@ const deserializeAws_restJson1DeleteLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1685,7 +1685,7 @@ const deserializeAws_restJson1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1735,7 +1735,7 @@ const deserializeAws_restJson1DeleteSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1797,7 +1797,7 @@ const deserializeAws_restJson1EvaluateFeatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1847,7 +1847,7 @@ const deserializeAws_restJson1GetExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1906,7 +1906,7 @@ const deserializeAws_restJson1GetExperimentResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1959,7 +1959,7 @@ const deserializeAws_restJson1GetFeatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2009,7 +2009,7 @@ const deserializeAws_restJson1GetLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2059,7 +2059,7 @@ const deserializeAws_restJson1GetProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2109,7 +2109,7 @@ const deserializeAws_restJson1GetSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2162,7 +2162,7 @@ const deserializeAws_restJson1ListExperimentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2212,7 +2212,7 @@ const deserializeAws_restJson1ListFeaturesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2265,7 +2265,7 @@ const deserializeAws_restJson1ListLaunchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2315,7 +2315,7 @@ const deserializeAws_restJson1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2365,7 +2365,7 @@ const deserializeAws_restJson1ListSegmentReferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2418,7 +2418,7 @@ const deserializeAws_restJson1ListSegmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2465,7 +2465,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2515,7 +2515,7 @@ const deserializeAws_restJson1PutProjectEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2565,7 +2565,7 @@ const deserializeAws_restJson1StartExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2621,7 +2621,7 @@ const deserializeAws_restJson1StartLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2677,7 +2677,7 @@ const deserializeAws_restJson1StopExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2733,7 +2733,7 @@ const deserializeAws_restJson1StopLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2780,7 +2780,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2827,7 +2827,7 @@ const deserializeAws_restJson1TestSegmentPatternCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2871,7 +2871,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2918,7 +2918,7 @@ const deserializeAws_restJson1UpdateExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2968,7 +2968,7 @@ const deserializeAws_restJson1UpdateFeatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_restJson1UpdateLaunchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3071,7 +3071,7 @@ const deserializeAws_restJson1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3124,7 +3124,7 @@ const deserializeAws_restJson1UpdateProjectDataDeliveryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4456,6 +4456,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts index 63254568e03e..f35660374337 100644 --- a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts @@ -1000,7 +1000,7 @@ const deserializeAws_restJson1AssociateUserToPermissionGroupCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_restJson1CreateChangesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1118,7 +1118,7 @@ const deserializeAws_restJson1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1180,7 +1180,7 @@ const deserializeAws_restJson1CreateDataViewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1236,7 +1236,7 @@ const deserializeAws_restJson1CreatePermissionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1292,7 +1292,7 @@ const deserializeAws_restJson1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1348,7 +1348,7 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1407,7 +1407,7 @@ const deserializeAws_restJson1DeletePermissionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1466,7 +1466,7 @@ const deserializeAws_restJson1DisableUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1522,7 +1522,7 @@ const deserializeAws_restJson1DisassociateUserFromPermissionGroupCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1578,7 +1578,7 @@ const deserializeAws_restJson1EnableUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1673,7 +1673,7 @@ const deserializeAws_restJson1GetChangesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1756,7 +1756,7 @@ const deserializeAws_restJson1GetDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1848,7 +1848,7 @@ const deserializeAws_restJson1GetDataViewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1904,7 +1904,7 @@ const deserializeAws_restJson1GetExternalDataViewAccessDetailsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1957,7 +1957,7 @@ const deserializeAws_restJson1GetPermissionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2013,7 +2013,7 @@ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2099,7 +2099,7 @@ const deserializeAws_restJson1GetUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2158,7 +2158,7 @@ const deserializeAws_restJson1GetWorkingLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2211,7 +2211,7 @@ const deserializeAws_restJson1ListChangesetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2270,7 +2270,7 @@ const deserializeAws_restJson1ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2326,7 +2326,7 @@ const deserializeAws_restJson1ListDataViewsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2382,7 +2382,7 @@ const deserializeAws_restJson1ListPermissionGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2435,7 +2435,7 @@ const deserializeAws_restJson1ListPermissionGroupsByUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2491,7 +2491,7 @@ const deserializeAws_restJson1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2544,7 +2544,7 @@ const deserializeAws_restJson1ListUsersByPermissionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2600,7 +2600,7 @@ const deserializeAws_restJson1ResetUserPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2659,7 +2659,7 @@ const deserializeAws_restJson1UpdateChangesetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2715,7 +2715,7 @@ const deserializeAws_restJson1UpdateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2771,7 +2771,7 @@ const deserializeAws_restJson1UpdatePermissionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2827,7 +2827,7 @@ const deserializeAws_restJson1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3568,6 +3568,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-finspace/src/protocols/Aws_restJson1.ts b/clients/client-finspace/src/protocols/Aws_restJson1.ts index 34bd4d268f98..0ed4bde6c477 100644 --- a/clients/client-finspace/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace/src/protocols/Aws_restJson1.ts @@ -293,7 +293,7 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -346,7 +346,7 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -399,7 +399,7 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -452,7 +452,7 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -496,7 +496,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -540,7 +540,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -584,7 +584,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -631,7 +631,7 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -939,6 +939,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-firehose/src/protocols/Aws_json1_1.ts b/clients/client-firehose/src/protocols/Aws_json1_1.ts index 8d5657ca7742..6572a10e6a15 100644 --- a/clients/client-firehose/src/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/src/protocols/Aws_json1_1.ts @@ -335,7 +335,7 @@ const deserializeAws_json1_1CreateDeliveryStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -385,7 +385,7 @@ const deserializeAws_json1_1DeleteDeliveryStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -429,7 +429,7 @@ const deserializeAws_json1_1DescribeDeliveryStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -470,7 +470,7 @@ const deserializeAws_json1_1ListDeliveryStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -505,7 +505,7 @@ const deserializeAws_json1_1ListTagsForDeliveryStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -552,7 +552,7 @@ const deserializeAws_json1_1PutRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -602,7 +602,7 @@ const deserializeAws_json1_1PutRecordBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -652,7 +652,7 @@ const deserializeAws_json1_1StartDeliveryStreamEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -705,7 +705,7 @@ const deserializeAws_json1_1StopDeliveryStreamEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -755,7 +755,7 @@ const deserializeAws_json1_1TagDeliveryStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -805,7 +805,7 @@ const deserializeAws_json1_1UntagDeliveryStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -855,7 +855,7 @@ const deserializeAws_json1_1UpdateDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3114,6 +3114,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-fis/src/protocols/Aws_restJson1.ts b/clients/client-fis/src/protocols/Aws_restJson1.ts index 78bea6917a13..2e0ec3a436b0 100644 --- a/clients/client-fis/src/protocols/Aws_restJson1.ts +++ b/clients/client-fis/src/protocols/Aws_restJson1.ts @@ -541,7 +541,7 @@ const deserializeAws_restJson1CreateExperimentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -591,7 +591,7 @@ const deserializeAws_restJson1DeleteExperimentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -635,7 +635,7 @@ const deserializeAws_restJson1GetActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -679,7 +679,7 @@ const deserializeAws_restJson1GetExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -723,7 +723,7 @@ const deserializeAws_restJson1GetExperimentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -767,7 +767,7 @@ const deserializeAws_restJson1GetTargetResourceTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -814,7 +814,7 @@ const deserializeAws_restJson1ListActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -858,7 +858,7 @@ const deserializeAws_restJson1ListExperimentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -905,7 +905,7 @@ const deserializeAws_restJson1ListExperimentTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -946,7 +946,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -987,7 +987,7 @@ const deserializeAws_restJson1ListTargetResourceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1028,7 +1028,7 @@ const deserializeAws_restJson1StartExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1078,7 +1078,7 @@ const deserializeAws_restJson1StopExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1119,7 +1119,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1151,7 +1151,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1186,7 +1186,7 @@ const deserializeAws_restJson1UpdateExperimentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2410,6 +2410,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-fms/src/protocols/Aws_json1_1.ts b/clients/client-fms/src/protocols/Aws_json1_1.ts index 388f94dc7ae1..126837f91b2f 100644 --- a/clients/client-fms/src/protocols/Aws_json1_1.ts +++ b/clients/client-fms/src/protocols/Aws_json1_1.ts @@ -632,7 +632,7 @@ const deserializeAws_json1_1AssociateAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -685,7 +685,7 @@ const deserializeAws_json1_1AssociateThirdPartyFirewallCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -732,7 +732,7 @@ const deserializeAws_json1_1DeleteAppsListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -776,7 +776,7 @@ const deserializeAws_json1_1DeleteNotificationChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -820,7 +820,7 @@ const deserializeAws_json1_1DeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -870,7 +870,7 @@ const deserializeAws_json1_1DeleteProtocolsListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -914,7 +914,7 @@ const deserializeAws_json1_1DisassociateAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -961,7 +961,7 @@ const deserializeAws_json1_1DisassociateThirdPartyFirewallCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1011,7 +1011,7 @@ const deserializeAws_json1_1GetAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1058,7 +1058,7 @@ const deserializeAws_json1_1GetAppsListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1105,7 +1105,7 @@ const deserializeAws_json1_1GetComplianceDetailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1155,7 +1155,7 @@ const deserializeAws_json1_1GetNotificationChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1202,7 +1202,7 @@ const deserializeAws_json1_1GetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1252,7 +1252,7 @@ const deserializeAws_json1_1GetProtectionStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1299,7 +1299,7 @@ const deserializeAws_json1_1GetProtocolsListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1346,7 +1346,7 @@ const deserializeAws_json1_1GetThirdPartyFirewallAssociationStatusCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1396,7 +1396,7 @@ const deserializeAws_json1_1GetViolationDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1443,7 +1443,7 @@ const deserializeAws_json1_1ListAppsListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1493,7 +1493,7 @@ const deserializeAws_json1_1ListComplianceStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1537,7 +1537,7 @@ const deserializeAws_json1_1ListMemberAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1581,7 +1581,7 @@ const deserializeAws_json1_1ListPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1631,7 +1631,7 @@ const deserializeAws_json1_1ListProtocolsListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1678,7 +1678,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1728,7 +1728,7 @@ const deserializeAws_json1_1ListThirdPartyFirewallFirewallPoliciesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1778,7 +1778,7 @@ const deserializeAws_json1_1PutAppsListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1828,7 +1828,7 @@ const deserializeAws_json1_1PutNotificationChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1875,7 +1875,7 @@ const deserializeAws_json1_1PutPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1931,7 +1931,7 @@ const deserializeAws_json1_1PutProtocolsListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1984,7 +1984,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2037,7 +2037,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4397,6 +4397,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-forecast/src/protocols/Aws_json1_1.ts b/clients/client-forecast/src/protocols/Aws_json1_1.ts index 279a0773fc69..e743b0792746 100644 --- a/clients/client-forecast/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/src/protocols/Aws_json1_1.ts @@ -1216,7 +1216,7 @@ const deserializeAws_json1_1CreateAutoPredictorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1269,7 +1269,7 @@ const deserializeAws_json1_1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1316,7 +1316,7 @@ const deserializeAws_json1_1CreateDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1369,7 +1369,7 @@ const deserializeAws_json1_1CreateDatasetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1422,7 +1422,7 @@ const deserializeAws_json1_1CreateExplainabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1475,7 +1475,7 @@ const deserializeAws_json1_1CreateExplainabilityExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_json1_1CreateForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1581,7 +1581,7 @@ const deserializeAws_json1_1CreateForecastExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1634,7 +1634,7 @@ const deserializeAws_json1_1CreateMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1687,7 +1687,7 @@ const deserializeAws_json1_1CreatePredictorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_json1_1CreatePredictorBacktestExportJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_json1_1CreateWhatIfAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1846,7 +1846,7 @@ const deserializeAws_json1_1CreateWhatIfForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1899,7 +1899,7 @@ const deserializeAws_json1_1CreateWhatIfForecastExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1949,7 +1949,7 @@ const deserializeAws_json1_1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1993,7 +1993,7 @@ const deserializeAws_json1_1DeleteDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2037,7 +2037,7 @@ const deserializeAws_json1_1DeleteDatasetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2081,7 +2081,7 @@ const deserializeAws_json1_1DeleteExplainabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2125,7 +2125,7 @@ const deserializeAws_json1_1DeleteExplainabilityExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2169,7 +2169,7 @@ const deserializeAws_json1_1DeleteForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2213,7 +2213,7 @@ const deserializeAws_json1_1DeleteForecastExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2257,7 +2257,7 @@ const deserializeAws_json1_1DeleteMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2301,7 +2301,7 @@ const deserializeAws_json1_1DeletePredictorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2345,7 +2345,7 @@ const deserializeAws_json1_1DeletePredictorBacktestExportJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2389,7 +2389,7 @@ const deserializeAws_json1_1DeleteResourceTreeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2433,7 +2433,7 @@ const deserializeAws_json1_1DeleteWhatIfAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2477,7 +2477,7 @@ const deserializeAws_json1_1DeleteWhatIfForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2521,7 +2521,7 @@ const deserializeAws_json1_1DeleteWhatIfForecastExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2568,7 +2568,7 @@ const deserializeAws_json1_1DescribeAutoPredictorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2612,7 +2612,7 @@ const deserializeAws_json1_1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2656,7 +2656,7 @@ const deserializeAws_json1_1DescribeDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2700,7 +2700,7 @@ const deserializeAws_json1_1DescribeDatasetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2744,7 +2744,7 @@ const deserializeAws_json1_1DescribeExplainabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2788,7 +2788,7 @@ const deserializeAws_json1_1DescribeExplainabilityExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2832,7 +2832,7 @@ const deserializeAws_json1_1DescribeForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2876,7 +2876,7 @@ const deserializeAws_json1_1DescribeForecastExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2920,7 +2920,7 @@ const deserializeAws_json1_1DescribeMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2964,7 +2964,7 @@ const deserializeAws_json1_1DescribePredictorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3008,7 +3008,7 @@ const deserializeAws_json1_1DescribePredictorBacktestExportJobCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3052,7 +3052,7 @@ const deserializeAws_json1_1DescribeWhatIfAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3096,7 +3096,7 @@ const deserializeAws_json1_1DescribeWhatIfForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3140,7 +3140,7 @@ const deserializeAws_json1_1DescribeWhatIfForecastExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3184,7 +3184,7 @@ const deserializeAws_json1_1GetAccuracyMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3231,7 +3231,7 @@ const deserializeAws_json1_1ListDatasetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3272,7 +3272,7 @@ const deserializeAws_json1_1ListDatasetImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3316,7 +3316,7 @@ const deserializeAws_json1_1ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3357,7 +3357,7 @@ const deserializeAws_json1_1ListExplainabilitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3401,7 +3401,7 @@ const deserializeAws_json1_1ListExplainabilityExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3445,7 +3445,7 @@ const deserializeAws_json1_1ListForecastExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3489,7 +3489,7 @@ const deserializeAws_json1_1ListForecastsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3533,7 +3533,7 @@ const deserializeAws_json1_1ListMonitorEvaluationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3580,7 +3580,7 @@ const deserializeAws_json1_1ListMonitorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3624,7 +3624,7 @@ const deserializeAws_json1_1ListPredictorBacktestExportJobsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3668,7 +3668,7 @@ const deserializeAws_json1_1ListPredictorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3712,7 +3712,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3756,7 +3756,7 @@ const deserializeAws_json1_1ListWhatIfAnalysesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3800,7 +3800,7 @@ const deserializeAws_json1_1ListWhatIfForecastExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3844,7 +3844,7 @@ const deserializeAws_json1_1ListWhatIfForecastsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3885,7 +3885,7 @@ const deserializeAws_json1_1ResumeResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3932,7 +3932,7 @@ const deserializeAws_json1_1StopResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3979,7 +3979,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4026,7 +4026,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4070,7 +4070,7 @@ const deserializeAws_json1_1UpdateDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7501,6 +7501,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts index 0c854a66d141..d575995e3769 100644 --- a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts @@ -82,7 +82,7 @@ const deserializeAws_json1_1QueryForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -135,7 +135,7 @@ const deserializeAws_json1_1QueryWhatIfForecastCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -406,6 +406,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts index 5b7cc5e9502c..516548872c59 100644 --- a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts @@ -1272,7 +1272,7 @@ const deserializeAws_json1_1BatchCreateVariableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1322,7 +1322,7 @@ const deserializeAws_json1_1BatchGetVariableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1372,7 +1372,7 @@ const deserializeAws_json1_1CancelBatchImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1425,7 +1425,7 @@ const deserializeAws_json1_1CancelBatchPredictionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_json1_1CreateBatchImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_json1_1CreateBatchPredictionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1584,7 +1584,7 @@ const deserializeAws_json1_1CreateDetectorVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1637,7 +1637,7 @@ const deserializeAws_json1_1CreateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1687,7 +1687,7 @@ const deserializeAws_json1_1CreateModelVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_json1_1CreateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1790,7 +1790,7 @@ const deserializeAws_json1_1CreateVariableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_json1_1DeleteBatchImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1890,7 +1890,7 @@ const deserializeAws_json1_1DeleteBatchPredictionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_json1_1DeleteDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1993,7 +1993,7 @@ const deserializeAws_json1_1DeleteDetectorVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2049,7 +2049,7 @@ const deserializeAws_json1_1DeleteEntityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2102,7 +2102,7 @@ const deserializeAws_json1_1DeleteEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2152,7 +2152,7 @@ const deserializeAws_json1_1DeleteEventsByEventTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2208,7 +2208,7 @@ const deserializeAws_json1_1DeleteEventTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2261,7 +2261,7 @@ const deserializeAws_json1_1DeleteExternalModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2314,7 +2314,7 @@ const deserializeAws_json1_1DeleteLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2364,7 +2364,7 @@ const deserializeAws_json1_1DeleteModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2417,7 +2417,7 @@ const deserializeAws_json1_1DeleteModelVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2470,7 +2470,7 @@ const deserializeAws_json1_1DeleteOutcomeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2523,7 +2523,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2576,7 +2576,7 @@ const deserializeAws_json1_1DeleteVariableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2629,7 +2629,7 @@ const deserializeAws_json1_1DescribeDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2682,7 +2682,7 @@ const deserializeAws_json1_1DescribeModelVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2735,7 +2735,7 @@ const deserializeAws_json1_1GetBatchImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2788,7 +2788,7 @@ const deserializeAws_json1_1GetBatchPredictionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2841,7 +2841,7 @@ const deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2894,7 +2894,7 @@ const deserializeAws_json1_1GetDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2947,7 +2947,7 @@ const deserializeAws_json1_1GetDetectorVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3000,7 +3000,7 @@ const deserializeAws_json1_1GetEntityTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3053,7 +3053,7 @@ const deserializeAws_json1_1GetEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3106,7 +3106,7 @@ const deserializeAws_json1_1GetEventPredictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3165,7 +3165,7 @@ const deserializeAws_json1_1GetEventPredictionMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3218,7 +3218,7 @@ const deserializeAws_json1_1GetEventTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3271,7 +3271,7 @@ const deserializeAws_json1_1GetExternalModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3324,7 +3324,7 @@ const deserializeAws_json1_1GetKMSEncryptionKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3374,7 +3374,7 @@ const deserializeAws_json1_1GetLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3427,7 +3427,7 @@ const deserializeAws_json1_1GetModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3480,7 +3480,7 @@ const deserializeAws_json1_1GetModelVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3533,7 +3533,7 @@ const deserializeAws_json1_1GetOutcomesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3586,7 +3586,7 @@ const deserializeAws_json1_1GetRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3639,7 +3639,7 @@ const deserializeAws_json1_1GetVariablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3692,7 +3692,7 @@ const deserializeAws_json1_1ListEventPredictionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3742,7 +3742,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3792,7 +3792,7 @@ const deserializeAws_json1_1PutDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3845,7 +3845,7 @@ const deserializeAws_json1_1PutEntityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3898,7 +3898,7 @@ const deserializeAws_json1_1PutEventTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3951,7 +3951,7 @@ const deserializeAws_json1_1PutExternalModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4004,7 +4004,7 @@ const deserializeAws_json1_1PutKMSEncryptionKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4060,7 +4060,7 @@ const deserializeAws_json1_1PutLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4113,7 +4113,7 @@ const deserializeAws_json1_1PutOutcomeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4166,7 +4166,7 @@ const deserializeAws_json1_1SendEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4222,7 +4222,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4272,7 +4272,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4322,7 +4322,7 @@ const deserializeAws_json1_1UpdateDetectorVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4378,7 +4378,7 @@ const deserializeAws_json1_1UpdateDetectorVersionMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4431,7 +4431,7 @@ const deserializeAws_json1_1UpdateDetectorVersionStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4487,7 +4487,7 @@ const deserializeAws_json1_1UpdateEventLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4543,7 +4543,7 @@ const deserializeAws_json1_1UpdateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4599,7 +4599,7 @@ const deserializeAws_json1_1UpdateModelVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4655,7 +4655,7 @@ const deserializeAws_json1_1UpdateModelVersionStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4711,7 +4711,7 @@ const deserializeAws_json1_1UpdateRuleMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4767,7 +4767,7 @@ const deserializeAws_json1_1UpdateRuleVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4823,7 +4823,7 @@ const deserializeAws_json1_1UpdateVariableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7890,6 +7890,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-fsx/src/protocols/Aws_json1_1.ts b/clients/client-fsx/src/protocols/Aws_json1_1.ts index ed37e7378f99..66952f01770b 100644 --- a/clients/client-fsx/src/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/src/protocols/Aws_json1_1.ts @@ -814,7 +814,7 @@ const deserializeAws_json1_1AssociateFileSystemAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -861,7 +861,7 @@ const deserializeAws_json1_1CancelDataRepositoryTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -914,7 +914,7 @@ const deserializeAws_json1_1CopyBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -985,7 +985,7 @@ const deserializeAws_json1_1CreateBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1047,7 +1047,7 @@ const deserializeAws_json1_1CreateDataRepositoryAssociationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1103,7 +1103,7 @@ const deserializeAws_json1_1CreateDataRepositoryTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1162,7 +1162,7 @@ const deserializeAws_json1_1CreateFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1230,7 +1230,7 @@ const deserializeAws_json1_1CreateFileSystemFromBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1295,7 +1295,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1345,7 +1345,7 @@ const deserializeAws_json1_1CreateStorageVirtualMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1404,7 +1404,7 @@ const deserializeAws_json1_1CreateVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1466,7 +1466,7 @@ const deserializeAws_json1_1CreateVolumeFromBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_json1_1DeleteBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1587,7 +1587,7 @@ const deserializeAws_json1_1DeleteDataRepositoryAssociationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1640,7 +1640,7 @@ const deserializeAws_json1_1DeleteFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1693,7 +1693,7 @@ const deserializeAws_json1_1DeleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_json1_1DeleteStorageVirtualMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1790,7 +1790,7 @@ const deserializeAws_json1_1DeleteVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1893,7 +1893,7 @@ const deserializeAws_json1_1DescribeDataRepositoryAssociationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1946,7 +1946,7 @@ const deserializeAws_json1_1DescribeDataRepositoryTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1996,7 +1996,7 @@ const deserializeAws_json1_1DescribeFileSystemAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2043,7 +2043,7 @@ const deserializeAws_json1_1DescribeFileSystemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2090,7 +2090,7 @@ const deserializeAws_json1_1DescribeSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2137,7 +2137,7 @@ const deserializeAws_json1_1DescribeStorageVirtualMachinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2184,7 +2184,7 @@ const deserializeAws_json1_1DescribeVolumesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2231,7 +2231,7 @@ const deserializeAws_json1_1DisassociateFileSystemAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2278,7 +2278,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2331,7 +2331,7 @@ const deserializeAws_json1_1ReleaseFileSystemNfsV3LocksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,7 +2384,7 @@ const deserializeAws_json1_1RestoreVolumeFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2431,7 +2431,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2484,7 +2484,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2537,7 +2537,7 @@ const deserializeAws_json1_1UpdateDataRepositoryAssociationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2590,7 +2590,7 @@ const deserializeAws_json1_1UpdateFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2649,7 +2649,7 @@ const deserializeAws_json1_1UpdateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2696,7 +2696,7 @@ const deserializeAws_json1_1UpdateStorageVirtualMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2749,7 +2749,7 @@ const deserializeAws_json1_1UpdateVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6269,6 +6269,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-gamelift/src/protocols/Aws_json1_1.ts b/clients/client-gamelift/src/protocols/Aws_json1_1.ts index 2ad913a59352..5bb0007a2c8f 100644 --- a/clients/client-gamelift/src/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/src/protocols/Aws_json1_1.ts @@ -1807,7 +1807,7 @@ const deserializeAws_json1_1AcceptMatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1857,7 +1857,7 @@ const deserializeAws_json1_1ClaimGameServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1913,7 +1913,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1969,7 +1969,7 @@ const deserializeAws_json1_1CreateBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2022,7 +2022,7 @@ const deserializeAws_json1_1CreateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2084,7 +2084,7 @@ const deserializeAws_json1_1CreateFleetLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2140,7 +2140,7 @@ const deserializeAws_json1_1CreateGameServerGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2193,7 +2193,7 @@ const deserializeAws_json1_1CreateGameSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2264,7 +2264,7 @@ const deserializeAws_json1_1CreateGameSessionQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2320,7 +2320,7 @@ const deserializeAws_json1_1CreateMatchmakingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2376,7 +2376,7 @@ const deserializeAws_json1_1CreateMatchmakingRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2426,7 +2426,7 @@ const deserializeAws_json1_1CreatePlayerSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2485,7 +2485,7 @@ const deserializeAws_json1_1CreatePlayerSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2544,7 +2544,7 @@ const deserializeAws_json1_1CreateScriptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2597,7 +2597,7 @@ const deserializeAws_json1_1CreateVpcPeeringAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2647,7 +2647,7 @@ const deserializeAws_json1_1CreateVpcPeeringConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2694,7 +2694,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2744,7 +2744,7 @@ const deserializeAws_json1_1DeleteBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2794,7 +2794,7 @@ const deserializeAws_json1_1DeleteFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2850,7 +2850,7 @@ const deserializeAws_json1_1DeleteFleetLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2903,7 +2903,7 @@ const deserializeAws_json1_1DeleteGameServerGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2953,7 +2953,7 @@ const deserializeAws_json1_1DeleteGameSessionQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3006,7 +3006,7 @@ const deserializeAws_json1_1DeleteMatchmakingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3059,7 +3059,7 @@ const deserializeAws_json1_1DeleteMatchmakingRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3109,7 +3109,7 @@ const deserializeAws_json1_1DeleteScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_json1_1DeleteScriptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3209,7 +3209,7 @@ const deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3259,7 +3259,7 @@ const deserializeAws_json1_1DeleteVpcPeeringConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3306,7 +3306,7 @@ const deserializeAws_json1_1DeregisterGameServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3356,7 +3356,7 @@ const deserializeAws_json1_1DescribeAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3406,7 +3406,7 @@ const deserializeAws_json1_1DescribeBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3456,7 +3456,7 @@ const deserializeAws_json1_1DescribeEC2InstanceLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3506,7 +3506,7 @@ const deserializeAws_json1_1DescribeFleetAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3556,7 +3556,7 @@ const deserializeAws_json1_1DescribeFleetCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3606,7 +3606,7 @@ const deserializeAws_json1_1DescribeFleetEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3656,7 +3656,7 @@ const deserializeAws_json1_1DescribeFleetLocationAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3709,7 +3709,7 @@ const deserializeAws_json1_1DescribeFleetLocationCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3762,7 +3762,7 @@ const deserializeAws_json1_1DescribeFleetLocationUtilizationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3815,7 +3815,7 @@ const deserializeAws_json1_1DescribeFleetPortSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3865,7 +3865,7 @@ const deserializeAws_json1_1DescribeFleetUtilizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3915,7 +3915,7 @@ const deserializeAws_json1_1DescribeGameServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3965,7 +3965,7 @@ const deserializeAws_json1_1DescribeGameServerGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4015,7 +4015,7 @@ const deserializeAws_json1_1DescribeGameServerInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4065,7 +4065,7 @@ const deserializeAws_json1_1DescribeGameSessionDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4121,7 +4121,7 @@ const deserializeAws_json1_1DescribeGameSessionPlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4171,7 +4171,7 @@ const deserializeAws_json1_1DescribeGameSessionQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4221,7 +4221,7 @@ const deserializeAws_json1_1DescribeGameSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4277,7 +4277,7 @@ const deserializeAws_json1_1DescribeInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4330,7 +4330,7 @@ const deserializeAws_json1_1DescribeMatchmakingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4377,7 +4377,7 @@ const deserializeAws_json1_1DescribeMatchmakingConfigurationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4424,7 +4424,7 @@ const deserializeAws_json1_1DescribeMatchmakingRuleSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4474,7 +4474,7 @@ const deserializeAws_json1_1DescribePlayerSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4524,7 +4524,7 @@ const deserializeAws_json1_1DescribeRuntimeConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4574,7 +4574,7 @@ const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4627,7 +4627,7 @@ const deserializeAws_json1_1DescribeScriptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4677,7 +4677,7 @@ const deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4724,7 +4724,7 @@ const deserializeAws_json1_1DescribeVpcPeeringConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4774,7 +4774,7 @@ const deserializeAws_json1_1GetGameSessionLogUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4824,7 +4824,7 @@ const deserializeAws_json1_1GetInstanceAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4874,7 +4874,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4921,7 +4921,7 @@ const deserializeAws_json1_1ListBuildsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4968,7 +4968,7 @@ const deserializeAws_json1_1ListFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5018,7 +5018,7 @@ const deserializeAws_json1_1ListGameServerGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5065,7 +5065,7 @@ const deserializeAws_json1_1ListGameServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5112,7 +5112,7 @@ const deserializeAws_json1_1ListScriptsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5159,7 +5159,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5209,7 +5209,7 @@ const deserializeAws_json1_1PutScalingPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5259,7 +5259,7 @@ const deserializeAws_json1_1RegisterGameServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5312,7 +5312,7 @@ const deserializeAws_json1_1RequestUploadCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5362,7 +5362,7 @@ const deserializeAws_json1_1ResolveAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5415,7 +5415,7 @@ const deserializeAws_json1_1ResumeGameServerGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5465,7 +5465,7 @@ const deserializeAws_json1_1SearchGameSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5521,7 +5521,7 @@ const deserializeAws_json1_1StartFleetActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5574,7 +5574,7 @@ const deserializeAws_json1_1StartGameSessionPlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5624,7 +5624,7 @@ const deserializeAws_json1_1StartMatchBackfillCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5674,7 +5674,7 @@ const deserializeAws_json1_1StartMatchmakingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5724,7 +5724,7 @@ const deserializeAws_json1_1StopFleetActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5777,7 +5777,7 @@ const deserializeAws_json1_1StopGameSessionPlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5827,7 +5827,7 @@ const deserializeAws_json1_1StopMatchmakingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5877,7 +5877,7 @@ const deserializeAws_json1_1SuspendGameServerGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5927,7 +5927,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5977,7 +5977,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6027,7 +6027,7 @@ const deserializeAws_json1_1UpdateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6077,7 +6077,7 @@ const deserializeAws_json1_1UpdateBuildCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6127,7 +6127,7 @@ const deserializeAws_json1_1UpdateFleetAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6186,7 +6186,7 @@ const deserializeAws_json1_1UpdateFleetCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6248,7 +6248,7 @@ const deserializeAws_json1_1UpdateFleetPortSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6307,7 +6307,7 @@ const deserializeAws_json1_1UpdateGameServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6357,7 +6357,7 @@ const deserializeAws_json1_1UpdateGameServerGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6407,7 +6407,7 @@ const deserializeAws_json1_1UpdateGameSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6463,7 +6463,7 @@ const deserializeAws_json1_1UpdateGameSessionQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6513,7 +6513,7 @@ const deserializeAws_json1_1UpdateMatchmakingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6563,7 +6563,7 @@ const deserializeAws_json1_1UpdateRuntimeConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6616,7 +6616,7 @@ const deserializeAws_json1_1UpdateScriptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6666,7 +6666,7 @@ const deserializeAws_json1_1ValidateMatchmakingRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10795,6 +10795,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-gamesparks/src/protocols/Aws_restJson1.ts b/clients/client-gamesparks/src/protocols/Aws_restJson1.ts index f286e07633c7..ff7180e98462 100644 --- a/clients/client-gamesparks/src/protocols/Aws_restJson1.ts +++ b/clients/client-gamesparks/src/protocols/Aws_restJson1.ts @@ -977,7 +977,7 @@ const deserializeAws_restJson1CreateGameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1033,7 +1033,7 @@ const deserializeAws_restJson1CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1089,7 +1089,7 @@ const deserializeAws_restJson1CreateStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1142,7 +1142,7 @@ const deserializeAws_restJson1DeleteGameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1192,7 +1192,7 @@ const deserializeAws_restJson1DeleteStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1251,7 +1251,7 @@ const deserializeAws_restJson1DisconnectPlayerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1304,7 +1304,7 @@ const deserializeAws_restJson1ExportSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1357,7 +1357,7 @@ const deserializeAws_restJson1GetExtensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1410,7 +1410,7 @@ const deserializeAws_restJson1GetExtensionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1463,7 +1463,7 @@ const deserializeAws_restJson1GetGameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1516,7 +1516,7 @@ const deserializeAws_restJson1GetGameConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1569,7 +1569,7 @@ const deserializeAws_restJson1GetGeneratedCodeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1622,7 +1622,7 @@ const deserializeAws_restJson1GetPlayerConnectionStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1675,7 +1675,7 @@ const deserializeAws_restJson1GetSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1728,7 +1728,7 @@ const deserializeAws_restJson1GetStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1781,7 +1781,7 @@ const deserializeAws_restJson1GetStageDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1834,7 +1834,7 @@ const deserializeAws_restJson1ImportGameConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1893,7 +1893,7 @@ const deserializeAws_restJson1ListExtensionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1946,7 +1946,7 @@ const deserializeAws_restJson1ListExtensionVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2002,7 +2002,7 @@ const deserializeAws_restJson1ListGamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2055,7 +2055,7 @@ const deserializeAws_restJson1ListGeneratedCodeJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2111,7 +2111,7 @@ const deserializeAws_restJson1ListSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2167,7 +2167,7 @@ const deserializeAws_restJson1ListStageDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2223,7 +2223,7 @@ const deserializeAws_restJson1ListStagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2276,7 +2276,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2323,7 +2323,7 @@ const deserializeAws_restJson1StartGeneratedCodeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2376,7 +2376,7 @@ const deserializeAws_restJson1StartStageDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2473,7 +2473,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2520,7 +2520,7 @@ const deserializeAws_restJson1UpdateGameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2573,7 +2573,7 @@ const deserializeAws_restJson1UpdateGameConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2629,7 +2629,7 @@ const deserializeAws_restJson1UpdateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2682,7 +2682,7 @@ const deserializeAws_restJson1UpdateStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3222,6 +3222,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-glacier/src/protocols/Aws_restJson1.ts b/clients/client-glacier/src/protocols/Aws_restJson1.ts index b54cad459230..69ac6fee8457 100644 --- a/clients/client-glacier/src/protocols/Aws_restJson1.ts +++ b/clients/client-glacier/src/protocols/Aws_restJson1.ts @@ -1004,7 +1004,7 @@ const deserializeAws_restJson1AbortMultipartUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1051,7 +1051,7 @@ const deserializeAws_restJson1AbortVaultLockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1098,7 +1098,7 @@ const deserializeAws_restJson1AddTagsToVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1151,7 +1151,7 @@ const deserializeAws_restJson1CompleteMultipartUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1198,7 +1198,7 @@ const deserializeAws_restJson1CompleteVaultLockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1246,7 +1246,7 @@ const deserializeAws_restJson1CreateVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1293,7 +1293,7 @@ const deserializeAws_restJson1DeleteArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1340,7 +1340,7 @@ const deserializeAws_restJson1DeleteVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1387,7 +1387,7 @@ const deserializeAws_restJson1DeleteVaultAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1434,7 +1434,7 @@ const deserializeAws_restJson1DeleteVaultNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1547,7 +1547,7 @@ const deserializeAws_restJson1DescribeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1612,7 +1612,7 @@ const deserializeAws_restJson1DescribeVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1662,7 +1662,7 @@ const deserializeAws_restJson1GetDataRetrievalPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1715,7 +1715,7 @@ const deserializeAws_restJson1GetJobOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1763,7 +1763,7 @@ const deserializeAws_restJson1GetVaultAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1822,7 +1822,7 @@ const deserializeAws_restJson1GetVaultLockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1870,7 +1870,7 @@ const deserializeAws_restJson1GetVaultNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1920,7 +1920,7 @@ const deserializeAws_restJson1InitiateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1975,7 +1975,7 @@ const deserializeAws_restJson1InitiateMultipartUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2023,7 +2023,7 @@ const deserializeAws_restJson1InitiateVaultLockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2076,7 +2076,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2129,7 +2129,7 @@ const deserializeAws_restJson1ListMultipartUploadsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2197,7 +2197,7 @@ const deserializeAws_restJson1ListPartsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2250,7 +2250,7 @@ const deserializeAws_restJson1ListProvisionedCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2297,7 +2297,7 @@ const deserializeAws_restJson1ListTagsForVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2350,7 +2350,7 @@ const deserializeAws_restJson1ListVaultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2398,7 +2398,7 @@ const deserializeAws_restJson1PurchaseProvisionedCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2445,7 +2445,7 @@ const deserializeAws_restJson1RemoveTagsFromVaultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2492,7 +2492,7 @@ const deserializeAws_restJson1SetDataRetrievalPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2536,7 +2536,7 @@ const deserializeAws_restJson1SetVaultAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2583,7 +2583,7 @@ const deserializeAws_restJson1SetVaultNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2633,7 +2633,7 @@ const deserializeAws_restJson1UploadArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2684,7 +2684,7 @@ const deserializeAws_restJson1UploadMultipartPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3479,6 +3479,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts index 28461db19576..68ec4845477e 100644 --- a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts @@ -928,7 +928,7 @@ const deserializeAws_json1_1AddCustomRoutingEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -987,7 +987,7 @@ const deserializeAws_json1_1AdvertiseByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1037,7 +1037,7 @@ const deserializeAws_json1_1AllowCustomRoutingTrafficCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1084,7 +1084,7 @@ const deserializeAws_json1_1CreateAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1131,7 +1131,7 @@ const deserializeAws_json1_1CreateCustomRoutingAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1181,7 +1181,7 @@ const deserializeAws_json1_1CreateCustomRoutingEndpointGroupCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1243,7 +1243,7 @@ const deserializeAws_json1_1CreateCustomRoutingListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1296,7 +1296,7 @@ const deserializeAws_json1_1CreateEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1355,7 +1355,7 @@ const deserializeAws_json1_1CreateListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1405,7 +1405,7 @@ const deserializeAws_json1_1DeleteAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1455,7 +1455,7 @@ const deserializeAws_json1_1DeleteCustomRoutingAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1505,7 +1505,7 @@ const deserializeAws_json1_1DeleteCustomRoutingEndpointGroupCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1549,7 +1549,7 @@ const deserializeAws_json1_1DeleteCustomRoutingListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1596,7 +1596,7 @@ const deserializeAws_json1_1DeleteEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1640,7 +1640,7 @@ const deserializeAws_json1_1DeleteListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1687,7 +1687,7 @@ const deserializeAws_json1_1DenyCustomRoutingTrafficCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1734,7 +1734,7 @@ const deserializeAws_json1_1DeprovisionByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1787,7 +1787,7 @@ const deserializeAws_json1_1DescribeAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1834,7 +1834,7 @@ const deserializeAws_json1_1DescribeAcceleratorAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1881,7 +1881,7 @@ const deserializeAws_json1_1DescribeCustomRoutingAcceleratorCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1928,7 +1928,7 @@ const deserializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1975,7 +1975,7 @@ const deserializeAws_json1_1DescribeCustomRoutingEndpointGroupCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2022,7 +2022,7 @@ const deserializeAws_json1_1DescribeCustomRoutingListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2069,7 +2069,7 @@ const deserializeAws_json1_1DescribeEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2116,7 +2116,7 @@ const deserializeAws_json1_1DescribeListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2163,7 +2163,7 @@ const deserializeAws_json1_1ListAcceleratorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2210,7 +2210,7 @@ const deserializeAws_json1_1ListByoipCidrsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2260,7 +2260,7 @@ const deserializeAws_json1_1ListCustomRoutingAcceleratorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2307,7 +2307,7 @@ const deserializeAws_json1_1ListCustomRoutingEndpointGroupsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2357,7 +2357,7 @@ const deserializeAws_json1_1ListCustomRoutingListenersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2407,7 +2407,7 @@ const deserializeAws_json1_1ListCustomRoutingPortMappingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2460,7 +2460,7 @@ const deserializeAws_json1_1ListCustomRoutingPortMappingsByDestinationCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2510,7 +2510,7 @@ const deserializeAws_json1_1ListEndpointGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2560,7 +2560,7 @@ const deserializeAws_json1_1ListListenersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2610,7 +2610,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2657,7 +2657,7 @@ const deserializeAws_json1_1ProvisionByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2707,7 +2707,7 @@ const deserializeAws_json1_1RemoveCustomRoutingEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2763,7 +2763,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2810,7 +2810,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2857,7 +2857,7 @@ const deserializeAws_json1_1UpdateAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2907,7 +2907,7 @@ const deserializeAws_json1_1UpdateAcceleratorAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2957,7 +2957,7 @@ const deserializeAws_json1_1UpdateCustomRoutingAcceleratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3004,7 +3004,7 @@ const deserializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3054,7 +3054,7 @@ const deserializeAws_json1_1UpdateCustomRoutingListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3107,7 +3107,7 @@ const deserializeAws_json1_1UpdateEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3160,7 +3160,7 @@ const deserializeAws_json1_1UpdateListenerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3213,7 +3213,7 @@ const deserializeAws_json1_1WithdrawByoipCidrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5268,6 +5268,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-glue/src/protocols/Aws_json1_1.ts b/clients/client-glue/src/protocols/Aws_json1_1.ts index e782180ac0ce..21749c6478ea 100644 --- a/clients/client-glue/src/protocols/Aws_json1_1.ts +++ b/clients/client-glue/src/protocols/Aws_json1_1.ts @@ -3436,7 +3436,7 @@ const deserializeAws_json1_1BatchCreatePartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3495,7 +3495,7 @@ const deserializeAws_json1_1BatchDeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3539,7 +3539,7 @@ const deserializeAws_json1_1BatchDeletePartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3589,7 +3589,7 @@ const deserializeAws_json1_1BatchDeleteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3645,7 +3645,7 @@ const deserializeAws_json1_1BatchDeleteTableVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3695,7 +3695,7 @@ const deserializeAws_json1_1BatchGetBlueprintsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3742,7 +3742,7 @@ const deserializeAws_json1_1BatchGetCrawlersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,7 +3786,7 @@ const deserializeAws_json1_1BatchGetCustomEntityTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3833,7 +3833,7 @@ const deserializeAws_json1_1BatchGetDevEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3883,7 +3883,7 @@ const deserializeAws_json1_1BatchGetJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3930,7 +3930,7 @@ const deserializeAws_json1_1BatchGetPartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3986,7 +3986,7 @@ const deserializeAws_json1_1BatchGetTriggersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4033,7 +4033,7 @@ const deserializeAws_json1_1BatchGetWorkflowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4080,7 +4080,7 @@ const deserializeAws_json1_1BatchStopJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4127,7 +4127,7 @@ const deserializeAws_json1_1BatchUpdatePartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4180,7 +4180,7 @@ const deserializeAws_json1_1CancelMLTaskRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4230,7 +4230,7 @@ const deserializeAws_json1_1CancelStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4286,7 +4286,7 @@ const deserializeAws_json1_1CheckSchemaVersionValidityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4333,7 +4333,7 @@ const deserializeAws_json1_1CreateBlueprintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4386,7 +4386,7 @@ const deserializeAws_json1_1CreateClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4433,7 +4433,7 @@ const deserializeAws_json1_1CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4486,7 +4486,7 @@ const deserializeAws_json1_1CreateCrawlerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4536,7 +4536,7 @@ const deserializeAws_json1_1CreateCustomEntityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4595,7 +4595,7 @@ const deserializeAws_json1_1CreateDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4654,7 +4654,7 @@ const deserializeAws_json1_1CreateDevEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4716,7 +4716,7 @@ const deserializeAws_json1_1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4775,7 +4775,7 @@ const deserializeAws_json1_1CreateMLTransformCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4834,7 +4834,7 @@ const deserializeAws_json1_1CreatePartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4893,7 +4893,7 @@ const deserializeAws_json1_1CreatePartitionIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4952,7 +4952,7 @@ const deserializeAws_json1_1CreateRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5008,7 +5008,7 @@ const deserializeAws_json1_1CreateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5067,7 +5067,7 @@ const deserializeAws_json1_1CreateScriptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5114,7 +5114,7 @@ const deserializeAws_json1_1CreateSecurityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5167,7 +5167,7 @@ const deserializeAws_json1_1CreateSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5229,7 +5229,7 @@ const deserializeAws_json1_1CreateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5294,7 +5294,7 @@ const deserializeAws_json1_1CreateTriggerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5356,7 +5356,7 @@ const deserializeAws_json1_1CreateUserDefinedFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5415,7 +5415,7 @@ const deserializeAws_json1_1CreateWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5471,7 +5471,7 @@ const deserializeAws_json1_1DeleteBlueprintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5518,7 +5518,7 @@ const deserializeAws_json1_1DeleteClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5562,7 +5562,7 @@ const deserializeAws_json1_1DeleteColumnStatisticsForPartitionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5615,7 +5615,7 @@ const deserializeAws_json1_1DeleteColumnStatisticsForTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5668,7 +5668,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5712,7 +5712,7 @@ const deserializeAws_json1_1DeleteCrawlerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5762,7 +5762,7 @@ const deserializeAws_json1_1DeleteCustomEntityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5815,7 +5815,7 @@ const deserializeAws_json1_1DeleteDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5868,7 +5868,7 @@ const deserializeAws_json1_1DeleteDevEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5918,7 +5918,7 @@ const deserializeAws_json1_1DeleteJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5965,7 +5965,7 @@ const deserializeAws_json1_1DeleteMLTransformCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6015,7 +6015,7 @@ const deserializeAws_json1_1DeletePartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6065,7 +6065,7 @@ const deserializeAws_json1_1DeletePartitionIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6121,7 +6121,7 @@ const deserializeAws_json1_1DeleteRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6171,7 +6171,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6224,7 +6224,7 @@ const deserializeAws_json1_1DeleteSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6274,7 +6274,7 @@ const deserializeAws_json1_1DeleteSchemaVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6324,7 +6324,7 @@ const deserializeAws_json1_1DeleteSecurityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6374,7 +6374,7 @@ const deserializeAws_json1_1DeleteSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6430,7 +6430,7 @@ const deserializeAws_json1_1DeleteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6486,7 +6486,7 @@ const deserializeAws_json1_1DeleteTableVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6536,7 +6536,7 @@ const deserializeAws_json1_1DeleteTriggerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6586,7 +6586,7 @@ const deserializeAws_json1_1DeleteUserDefinedFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6636,7 +6636,7 @@ const deserializeAws_json1_1DeleteWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6686,7 +6686,7 @@ const deserializeAws_json1_1GetBlueprintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6736,7 +6736,7 @@ const deserializeAws_json1_1GetBlueprintRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6783,7 +6783,7 @@ const deserializeAws_json1_1GetBlueprintRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6833,7 +6833,7 @@ const deserializeAws_json1_1GetCatalogImportStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6877,7 +6877,7 @@ const deserializeAws_json1_1GetClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6921,7 +6921,7 @@ const deserializeAws_json1_1GetClassifiersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6962,7 +6962,7 @@ const deserializeAws_json1_1GetColumnStatisticsForPartitionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7015,7 +7015,7 @@ const deserializeAws_json1_1GetColumnStatisticsForTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7068,7 +7068,7 @@ const deserializeAws_json1_1GetConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7118,7 +7118,7 @@ const deserializeAws_json1_1GetConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7168,7 +7168,7 @@ const deserializeAws_json1_1GetCrawlerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7212,7 +7212,7 @@ const deserializeAws_json1_1GetCrawlerMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7253,7 +7253,7 @@ const deserializeAws_json1_1GetCrawlersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7294,7 +7294,7 @@ const deserializeAws_json1_1GetCustomEntityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7347,7 +7347,7 @@ const deserializeAws_json1_1GetDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7400,7 +7400,7 @@ const deserializeAws_json1_1GetDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7450,7 +7450,7 @@ const deserializeAws_json1_1GetDataCatalogEncryptionSettingsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7497,7 +7497,7 @@ const deserializeAws_json1_1GetDataflowGraphCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7544,7 +7544,7 @@ const deserializeAws_json1_1GetDevEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7594,7 +7594,7 @@ const deserializeAws_json1_1GetDevEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7644,7 +7644,7 @@ const deserializeAws_json1_1GetJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7694,7 +7694,7 @@ const deserializeAws_json1_1GetJobBookmarkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7747,7 +7747,7 @@ const deserializeAws_json1_1GetJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7797,7 +7797,7 @@ const deserializeAws_json1_1GetJobRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7847,7 +7847,7 @@ const deserializeAws_json1_1GetJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7897,7 +7897,7 @@ const deserializeAws_json1_1GetMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7947,7 +7947,7 @@ const deserializeAws_json1_1GetMLTaskRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7997,7 +7997,7 @@ const deserializeAws_json1_1GetMLTaskRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8047,7 +8047,7 @@ const deserializeAws_json1_1GetMLTransformCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8097,7 +8097,7 @@ const deserializeAws_json1_1GetMLTransformsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8147,7 +8147,7 @@ const deserializeAws_json1_1GetPartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8200,7 +8200,7 @@ const deserializeAws_json1_1GetPartitionIndexesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8253,7 +8253,7 @@ const deserializeAws_json1_1GetPartitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8312,7 +8312,7 @@ const deserializeAws_json1_1GetPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8359,7 +8359,7 @@ const deserializeAws_json1_1GetRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8409,7 +8409,7 @@ const deserializeAws_json1_1GetResourcePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8459,7 +8459,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8509,7 +8509,7 @@ const deserializeAws_json1_1GetSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8559,7 +8559,7 @@ const deserializeAws_json1_1GetSchemaByDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8609,7 +8609,7 @@ const deserializeAws_json1_1GetSchemaVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8659,7 +8659,7 @@ const deserializeAws_json1_1GetSchemaVersionsDiffCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8709,7 +8709,7 @@ const deserializeAws_json1_1GetSecurityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8759,7 +8759,7 @@ const deserializeAws_json1_1GetSecurityConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8809,7 +8809,7 @@ const deserializeAws_json1_1GetSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8862,7 +8862,7 @@ const deserializeAws_json1_1GetStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8918,7 +8918,7 @@ const deserializeAws_json1_1GetTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8974,7 +8974,7 @@ const deserializeAws_json1_1GetTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9027,7 +9027,7 @@ const deserializeAws_json1_1GetTableVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9080,7 +9080,7 @@ const deserializeAws_json1_1GetTableVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9133,7 +9133,7 @@ const deserializeAws_json1_1GetTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9183,7 +9183,7 @@ const deserializeAws_json1_1GetTriggerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9233,7 +9233,7 @@ const deserializeAws_json1_1GetTriggersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9283,7 +9283,7 @@ const deserializeAws_json1_1GetUnfilteredPartitionMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9339,7 +9339,7 @@ const deserializeAws_json1_1GetUnfilteredPartitionsMetadataCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9395,7 +9395,7 @@ const deserializeAws_json1_1GetUnfilteredTableMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9451,7 +9451,7 @@ const deserializeAws_json1_1GetUserDefinedFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9504,7 +9504,7 @@ const deserializeAws_json1_1GetUserDefinedFunctionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9557,7 +9557,7 @@ const deserializeAws_json1_1GetWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9607,7 +9607,7 @@ const deserializeAws_json1_1GetWorkflowRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9657,7 +9657,7 @@ const deserializeAws_json1_1GetWorkflowRunPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9707,7 +9707,7 @@ const deserializeAws_json1_1GetWorkflowRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9757,7 +9757,7 @@ const deserializeAws_json1_1ImportCatalogToGlueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9801,7 +9801,7 @@ const deserializeAws_json1_1ListBlueprintsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9848,7 +9848,7 @@ const deserializeAws_json1_1ListCrawlersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9889,7 +9889,7 @@ const deserializeAws_json1_1ListCrawlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9936,7 +9936,7 @@ const deserializeAws_json1_1ListCustomEntityTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9983,7 +9983,7 @@ const deserializeAws_json1_1ListDevEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10033,7 +10033,7 @@ const deserializeAws_json1_1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10083,7 +10083,7 @@ const deserializeAws_json1_1ListMLTransformsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10133,7 +10133,7 @@ const deserializeAws_json1_1ListRegistriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10180,7 +10180,7 @@ const deserializeAws_json1_1ListSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10230,7 +10230,7 @@ const deserializeAws_json1_1ListSchemaVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10280,7 +10280,7 @@ const deserializeAws_json1_1ListSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10330,7 +10330,7 @@ const deserializeAws_json1_1ListStatementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10386,7 +10386,7 @@ const deserializeAws_json1_1ListTriggersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10436,7 +10436,7 @@ const deserializeAws_json1_1ListWorkflowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10483,7 +10483,7 @@ const deserializeAws_json1_1PutDataCatalogEncryptionSettingsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10530,7 +10530,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10583,7 +10583,7 @@ const deserializeAws_json1_1PutSchemaVersionMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10636,7 +10636,7 @@ const deserializeAws_json1_1PutWorkflowRunPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10695,7 +10695,7 @@ const deserializeAws_json1_1QuerySchemaVersionMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10742,7 +10742,7 @@ const deserializeAws_json1_1RegisterSchemaVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10798,7 +10798,7 @@ const deserializeAws_json1_1RemoveSchemaVersionMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10845,7 +10845,7 @@ const deserializeAws_json1_1ResetJobBookmarkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10895,7 +10895,7 @@ const deserializeAws_json1_1ResumeWorkflowRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10951,7 +10951,7 @@ const deserializeAws_json1_1RunStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11013,7 +11013,7 @@ const deserializeAws_json1_1SearchTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11060,7 +11060,7 @@ const deserializeAws_json1_1StartBlueprintRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11116,7 +11116,7 @@ const deserializeAws_json1_1StartCrawlerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11163,7 +11163,7 @@ const deserializeAws_json1_1StartCrawlerScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11216,7 +11216,7 @@ const deserializeAws_json1_1StartExportLabelsTaskRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11266,7 +11266,7 @@ const deserializeAws_json1_1StartImportLabelsTaskRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11319,7 +11319,7 @@ const deserializeAws_json1_1StartJobRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11375,7 +11375,7 @@ const deserializeAws_json1_1StartMLEvaluationTaskRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11431,7 +11431,7 @@ const deserializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11484,7 +11484,7 @@ const deserializeAws_json1_1StartTriggerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11540,7 +11540,7 @@ const deserializeAws_json1_1StartWorkflowRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11596,7 +11596,7 @@ const deserializeAws_json1_1StopCrawlerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11646,7 +11646,7 @@ const deserializeAws_json1_1StopCrawlerScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11696,7 +11696,7 @@ const deserializeAws_json1_1StopSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11752,7 +11752,7 @@ const deserializeAws_json1_1StopTriggerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11805,7 +11805,7 @@ const deserializeAws_json1_1StopWorkflowRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11858,7 +11858,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11908,7 +11908,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11958,7 +11958,7 @@ const deserializeAws_json1_1UpdateBlueprintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12014,7 +12014,7 @@ const deserializeAws_json1_1UpdateClassifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12064,7 +12064,7 @@ const deserializeAws_json1_1UpdateColumnStatisticsForPartitionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12117,7 +12117,7 @@ const deserializeAws_json1_1UpdateColumnStatisticsForTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12170,7 +12170,7 @@ const deserializeAws_json1_1UpdateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12220,7 +12220,7 @@ const deserializeAws_json1_1UpdateCrawlerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12273,7 +12273,7 @@ const deserializeAws_json1_1UpdateCrawlerScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12326,7 +12326,7 @@ const deserializeAws_json1_1UpdateDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12382,7 +12382,7 @@ const deserializeAws_json1_1UpdateDevEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12435,7 +12435,7 @@ const deserializeAws_json1_1UpdateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12488,7 +12488,7 @@ const deserializeAws_json1_1UpdateMLTransformCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12541,7 +12541,7 @@ const deserializeAws_json1_1UpdatePartitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12594,7 +12594,7 @@ const deserializeAws_json1_1UpdateRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12647,7 +12647,7 @@ const deserializeAws_json1_1UpdateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12700,7 +12700,7 @@ const deserializeAws_json1_1UpdateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12762,7 +12762,7 @@ const deserializeAws_json1_1UpdateTriggerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12815,7 +12815,7 @@ const deserializeAws_json1_1UpdateUserDefinedFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12868,7 +12868,7 @@ const deserializeAws_json1_1UpdateWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -24275,6 +24275,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-grafana/src/protocols/Aws_restJson1.ts b/clients/client-grafana/src/protocols/Aws_restJson1.ts index 1a08c039aef7..a3d9f3d4931f 100644 --- a/clients/client-grafana/src/protocols/Aws_restJson1.ts +++ b/clients/client-grafana/src/protocols/Aws_restJson1.ts @@ -547,7 +547,7 @@ const deserializeAws_restJson1AssociateLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -600,7 +600,7 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -662,7 +662,7 @@ const deserializeAws_restJson1CreateWorkspaceApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -721,7 +721,7 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -780,7 +780,7 @@ const deserializeAws_restJson1DeleteWorkspaceApiKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -836,7 +836,7 @@ const deserializeAws_restJson1DescribeWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -889,7 +889,7 @@ const deserializeAws_restJson1DescribeWorkspaceAuthenticationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -942,7 +942,7 @@ const deserializeAws_restJson1DisassociateLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -998,7 +998,7 @@ const deserializeAws_restJson1ListPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1051,7 +1051,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1107,7 +1107,7 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1151,7 +1151,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1201,7 +1201,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1254,7 +1254,7 @@ const deserializeAws_restJson1UpdatePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1307,7 +1307,7 @@ const deserializeAws_restJson1UpdateWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1363,7 +1363,7 @@ const deserializeAws_restJson1UpdateWorkspaceAuthenticationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2077,6 +2077,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-greengrass/src/protocols/Aws_restJson1.ts b/clients/client-greengrass/src/protocols/Aws_restJson1.ts index 8c6ce211f80b..1f8f6c996cb4 100644 --- a/clients/client-greengrass/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrass/src/protocols/Aws_restJson1.ts @@ -3153,7 +3153,7 @@ const deserializeAws_restJson1AssociateRoleToGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3197,7 +3197,7 @@ const deserializeAws_restJson1AssociateServiceRoleToAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3259,7 +3259,7 @@ const deserializeAws_restJson1CreateConnectorDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3309,7 +3309,7 @@ const deserializeAws_restJson1CreateConnectorDefinitionVersionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3368,7 +3368,7 @@ const deserializeAws_restJson1CreateCoreDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3418,7 +3418,7 @@ const deserializeAws_restJson1CreateCoreDefinitionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3462,7 +3462,7 @@ const deserializeAws_restJson1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3521,7 +3521,7 @@ const deserializeAws_restJson1CreateDeviceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3571,7 +3571,7 @@ const deserializeAws_restJson1CreateDeviceDefinitionVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3630,7 +3630,7 @@ const deserializeAws_restJson1CreateFunctionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3680,7 +3680,7 @@ const deserializeAws_restJson1CreateFunctionDefinitionVersionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3739,7 +3739,7 @@ const deserializeAws_restJson1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3780,7 +3780,7 @@ const deserializeAws_restJson1CreateGroupCertificateAuthorityCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3833,7 +3833,7 @@ const deserializeAws_restJson1CreateGroupVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3892,7 +3892,7 @@ const deserializeAws_restJson1CreateLoggerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3942,7 +3942,7 @@ const deserializeAws_restJson1CreateLoggerDefinitionVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4001,7 +4001,7 @@ const deserializeAws_restJson1CreateResourceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4051,7 +4051,7 @@ const deserializeAws_restJson1CreateResourceDefinitionVersionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4098,7 +4098,7 @@ const deserializeAws_restJson1CreateSoftwareUpdateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4160,7 +4160,7 @@ const deserializeAws_restJson1CreateSubscriptionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4210,7 +4210,7 @@ const deserializeAws_restJson1CreateSubscriptionDefinitionVersionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4248,7 +4248,7 @@ const deserializeAws_restJson1DeleteConnectorDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4286,7 +4286,7 @@ const deserializeAws_restJson1DeleteCoreDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4324,7 +4324,7 @@ const deserializeAws_restJson1DeleteDeviceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4362,7 +4362,7 @@ const deserializeAws_restJson1DeleteFunctionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4400,7 +4400,7 @@ const deserializeAws_restJson1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4438,7 +4438,7 @@ const deserializeAws_restJson1DeleteLoggerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4476,7 +4476,7 @@ const deserializeAws_restJson1DeleteResourceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4514,7 +4514,7 @@ const deserializeAws_restJson1DeleteSubscriptionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4555,7 +4555,7 @@ const deserializeAws_restJson1DisassociateRoleFromGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4599,7 +4599,7 @@ const deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4643,7 +4643,7 @@ const deserializeAws_restJson1GetAssociatedRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4702,7 +4702,7 @@ const deserializeAws_restJson1GetBulkDeploymentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4746,7 +4746,7 @@ const deserializeAws_restJson1GetConnectivityInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4811,7 +4811,7 @@ const deserializeAws_restJson1GetConnectorDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4867,7 +4867,7 @@ const deserializeAws_restJson1GetConnectorDefinitionVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4929,7 +4929,7 @@ const deserializeAws_restJson1GetCoreDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4985,7 +4985,7 @@ const deserializeAws_restJson1GetCoreDefinitionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5038,7 +5038,7 @@ const deserializeAws_restJson1GetDeploymentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5100,7 +5100,7 @@ const deserializeAws_restJson1GetDeviceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5156,7 +5156,7 @@ const deserializeAws_restJson1GetDeviceDefinitionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5218,7 +5218,7 @@ const deserializeAws_restJson1GetFunctionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5274,7 +5274,7 @@ const deserializeAws_restJson1GetFunctionDefinitionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5336,7 +5336,7 @@ const deserializeAws_restJson1GetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5383,7 +5383,7 @@ const deserializeAws_restJson1GetGroupCertificateAuthorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5433,7 +5433,7 @@ const deserializeAws_restJson1GetGroupCertificateConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5489,7 +5489,7 @@ const deserializeAws_restJson1GetGroupVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5551,7 +5551,7 @@ const deserializeAws_restJson1GetLoggerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5604,7 +5604,7 @@ const deserializeAws_restJson1GetLoggerDefinitionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5666,7 +5666,7 @@ const deserializeAws_restJson1GetResourceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5719,7 +5719,7 @@ const deserializeAws_restJson1GetResourceDefinitionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5763,7 +5763,7 @@ const deserializeAws_restJson1GetServiceRoleForAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5825,7 +5825,7 @@ const deserializeAws_restJson1GetSubscriptionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5881,7 +5881,7 @@ const deserializeAws_restJson1GetSubscriptionDefinitionVersionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5922,7 +5922,7 @@ const deserializeAws_restJson1GetThingRuntimeConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5969,7 +5969,7 @@ const deserializeAws_restJson1ListBulkDeploymentDetailedReportsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6013,7 +6013,7 @@ const deserializeAws_restJson1ListBulkDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6057,7 +6057,7 @@ const deserializeAws_restJson1ListConnectorDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6095,7 +6095,7 @@ const deserializeAws_restJson1ListConnectorDefinitionVersionsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6139,7 +6139,7 @@ const deserializeAws_restJson1ListCoreDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6177,7 +6177,7 @@ const deserializeAws_restJson1ListCoreDefinitionVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6221,7 +6221,7 @@ const deserializeAws_restJson1ListDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6265,7 +6265,7 @@ const deserializeAws_restJson1ListDeviceDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6303,7 +6303,7 @@ const deserializeAws_restJson1ListDeviceDefinitionVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6347,7 +6347,7 @@ const deserializeAws_restJson1ListFunctionDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6385,7 +6385,7 @@ const deserializeAws_restJson1ListFunctionDefinitionVersionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6429,7 +6429,7 @@ const deserializeAws_restJson1ListGroupCertificateAuthoritiesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6476,7 +6476,7 @@ const deserializeAws_restJson1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6514,7 +6514,7 @@ const deserializeAws_restJson1ListGroupVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6558,7 +6558,7 @@ const deserializeAws_restJson1ListLoggerDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6596,7 +6596,7 @@ const deserializeAws_restJson1ListLoggerDefinitionVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6640,7 +6640,7 @@ const deserializeAws_restJson1ListResourceDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6678,7 +6678,7 @@ const deserializeAws_restJson1ListResourceDefinitionVersionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6722,7 +6722,7 @@ const deserializeAws_restJson1ListSubscriptionDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6760,7 +6760,7 @@ const deserializeAws_restJson1ListSubscriptionDefinitionVersionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6801,7 +6801,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6845,7 +6845,7 @@ const deserializeAws_restJson1ResetDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6889,7 +6889,7 @@ const deserializeAws_restJson1StartBulkDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6927,7 +6927,7 @@ const deserializeAws_restJson1StopBulkDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6965,7 +6965,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7003,7 +7003,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7047,7 +7047,7 @@ const deserializeAws_restJson1UpdateConnectivityInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7088,7 +7088,7 @@ const deserializeAws_restJson1UpdateConnectorDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7126,7 +7126,7 @@ const deserializeAws_restJson1UpdateCoreDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7164,7 +7164,7 @@ const deserializeAws_restJson1UpdateDeviceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7202,7 +7202,7 @@ const deserializeAws_restJson1UpdateFunctionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7240,7 +7240,7 @@ const deserializeAws_restJson1UpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7287,7 +7287,7 @@ const deserializeAws_restJson1UpdateGroupCertificateConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7328,7 +7328,7 @@ const deserializeAws_restJson1UpdateLoggerDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7366,7 +7366,7 @@ const deserializeAws_restJson1UpdateResourceDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7404,7 +7404,7 @@ const deserializeAws_restJson1UpdateSubscriptionDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7442,7 +7442,7 @@ const deserializeAws_restJson1UpdateThingRuntimeConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8715,6 +8715,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts index e7f051552187..9aa846c99067 100644 --- a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts @@ -981,7 +981,7 @@ const deserializeAws_restJson1AssociateServiceRoleToAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1028,7 +1028,7 @@ const deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1084,7 +1084,7 @@ const deserializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_restJson1CancelDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1205,7 +1205,7 @@ const deserializeAws_restJson1CreateComponentVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1270,7 +1270,7 @@ const deserializeAws_restJson1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1326,7 +1326,7 @@ const deserializeAws_restJson1DeleteComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1379,7 +1379,7 @@ const deserializeAws_restJson1DeleteCoreDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1432,7 +1432,7 @@ const deserializeAws_restJson1DeleteDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1512,7 +1512,7 @@ const deserializeAws_restJson1DescribeComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1565,7 +1565,7 @@ const deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1612,7 +1612,7 @@ const deserializeAws_restJson1GetComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1665,7 +1665,7 @@ const deserializeAws_restJson1GetComponentVersionArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1721,7 +1721,7 @@ const deserializeAws_restJson1GetConnectivityInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1785,7 +1785,7 @@ const deserializeAws_restJson1GetCoreDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1877,7 +1877,7 @@ const deserializeAws_restJson1GetDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1933,7 +1933,7 @@ const deserializeAws_restJson1GetServiceRoleForAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1980,7 +1980,7 @@ const deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2036,7 +2036,7 @@ const deserializeAws_restJson1ListComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2092,7 +2092,7 @@ const deserializeAws_restJson1ListComponentVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2148,7 +2148,7 @@ const deserializeAws_restJson1ListCoreDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2201,7 +2201,7 @@ const deserializeAws_restJson1ListDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2257,7 +2257,7 @@ const deserializeAws_restJson1ListEffectiveDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2313,7 +2313,7 @@ const deserializeAws_restJson1ListInstalledComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2366,7 +2366,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2416,7 +2416,7 @@ const deserializeAws_restJson1ResolveComponentCandidatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2469,7 +2469,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2513,7 +2513,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2563,7 +2563,7 @@ const deserializeAws_restJson1UpdateConnectivityInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3878,6 +3878,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-groundstation/src/protocols/Aws_restJson1.ts b/clients/client-groundstation/src/protocols/Aws_restJson1.ts index 36ef7d33aadb..ca60e03fbb10 100644 --- a/clients/client-groundstation/src/protocols/Aws_restJson1.ts +++ b/clients/client-groundstation/src/protocols/Aws_restJson1.ts @@ -797,7 +797,7 @@ const deserializeAws_restJson1CancelContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -850,7 +850,7 @@ const deserializeAws_restJson1CreateConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -900,7 +900,7 @@ const deserializeAws_restJson1CreateDataflowEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -947,7 +947,7 @@ const deserializeAws_restJson1CreateMissionProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1000,7 +1000,7 @@ const deserializeAws_restJson1DeleteConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1047,7 +1047,7 @@ const deserializeAws_restJson1DeleteDataflowEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1094,7 +1094,7 @@ const deserializeAws_restJson1DeleteMissionProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1180,7 +1180,7 @@ const deserializeAws_restJson1DescribeContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1242,7 +1242,7 @@ const deserializeAws_restJson1GetConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1298,7 +1298,7 @@ const deserializeAws_restJson1GetDataflowEndpointGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1357,7 +1357,7 @@ const deserializeAws_restJson1GetMinuteUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1431,7 +1431,7 @@ const deserializeAws_restJson1GetMissionProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1487,7 +1487,7 @@ const deserializeAws_restJson1GetSatelliteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1537,7 +1537,7 @@ const deserializeAws_restJson1ListConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1587,7 +1587,7 @@ const deserializeAws_restJson1ListContactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1640,7 +1640,7 @@ const deserializeAws_restJson1ListDataflowEndpointGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1690,7 +1690,7 @@ const deserializeAws_restJson1ListGroundStationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_restJson1ListMissionProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1790,7 +1790,7 @@ const deserializeAws_restJson1ListSatellitesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1837,7 +1837,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1884,7 +1884,7 @@ const deserializeAws_restJson1ReserveContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1928,7 +1928,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1972,7 +1972,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2025,7 +2025,7 @@ const deserializeAws_restJson1UpdateConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2072,7 +2072,7 @@ const deserializeAws_restJson1UpdateMissionProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2961,6 +2961,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-guardduty/src/protocols/Aws_restJson1.ts b/clients/client-guardduty/src/protocols/Aws_restJson1.ts index ede3a97ed4c3..30f014082aa9 100644 --- a/clients/client-guardduty/src/protocols/Aws_restJson1.ts +++ b/clients/client-guardduty/src/protocols/Aws_restJson1.ts @@ -2080,7 +2080,7 @@ const deserializeAws_restJson1AcceptAdministratorInvitationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2121,7 +2121,7 @@ const deserializeAws_restJson1AcceptInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2162,7 +2162,7 @@ const deserializeAws_restJson1ArchiveFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2206,7 +2206,7 @@ const deserializeAws_restJson1CreateDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2250,7 +2250,7 @@ const deserializeAws_restJson1CreateFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2294,7 +2294,7 @@ const deserializeAws_restJson1CreateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2338,7 +2338,7 @@ const deserializeAws_restJson1CreateMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2382,7 +2382,7 @@ const deserializeAws_restJson1CreatePublishingDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2423,7 +2423,7 @@ const deserializeAws_restJson1CreateSampleFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2467,7 +2467,7 @@ const deserializeAws_restJson1CreateThreatIntelSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2511,7 +2511,7 @@ const deserializeAws_restJson1DeclineInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2552,7 +2552,7 @@ const deserializeAws_restJson1DeleteDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2593,7 +2593,7 @@ const deserializeAws_restJson1DeleteFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2637,7 +2637,7 @@ const deserializeAws_restJson1DeleteInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2678,7 +2678,7 @@ const deserializeAws_restJson1DeleteIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2722,7 +2722,7 @@ const deserializeAws_restJson1DeleteMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2763,7 +2763,7 @@ const deserializeAws_restJson1DeletePublishingDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2804,7 +2804,7 @@ const deserializeAws_restJson1DeleteThreatIntelSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2851,7 +2851,7 @@ const deserializeAws_restJson1DescribeMalwareScansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2904,7 +2904,7 @@ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2960,7 +2960,7 @@ const deserializeAws_restJson1DescribePublishingDestinationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3001,7 +3001,7 @@ const deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3042,7 +3042,7 @@ const deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3083,7 +3083,7 @@ const deserializeAws_restJson1DisassociateFromMasterAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3127,7 +3127,7 @@ const deserializeAws_restJson1DisassociateMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3168,7 +3168,7 @@ const deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3212,7 +3212,7 @@ const deserializeAws_restJson1GetAdministratorAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3274,7 +3274,7 @@ const deserializeAws_restJson1GetDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3333,7 +3333,7 @@ const deserializeAws_restJson1GetFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3377,7 +3377,7 @@ const deserializeAws_restJson1GetFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3421,7 +3421,7 @@ const deserializeAws_restJson1GetFindingsStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3465,7 +3465,7 @@ const deserializeAws_restJson1GetInvitationsCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3521,7 +3521,7 @@ const deserializeAws_restJson1GetIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3568,7 +3568,7 @@ const deserializeAws_restJson1GetMalwareScanSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3612,7 +3612,7 @@ const deserializeAws_restJson1GetMasterAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3662,7 +3662,7 @@ const deserializeAws_restJson1GetMemberDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3709,7 +3709,7 @@ const deserializeAws_restJson1GetMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3756,7 +3756,7 @@ const deserializeAws_restJson1GetRemainingFreeTrialDaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3812,7 +3812,7 @@ const deserializeAws_restJson1GetThreatIntelSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3859,7 +3859,7 @@ const deserializeAws_restJson1GetUsageStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3903,7 +3903,7 @@ const deserializeAws_restJson1InviteMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3950,7 +3950,7 @@ const deserializeAws_restJson1ListDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3997,7 +3997,7 @@ const deserializeAws_restJson1ListFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4044,7 +4044,7 @@ const deserializeAws_restJson1ListFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4091,7 +4091,7 @@ const deserializeAws_restJson1ListInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4138,7 +4138,7 @@ const deserializeAws_restJson1ListIPSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4185,7 +4185,7 @@ const deserializeAws_restJson1ListMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4232,7 +4232,7 @@ const deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4279,7 +4279,7 @@ const deserializeAws_restJson1ListPublishingDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4323,7 +4323,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4370,7 +4370,7 @@ const deserializeAws_restJson1ListThreatIntelSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4414,7 +4414,7 @@ const deserializeAws_restJson1StartMonitoringMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4458,7 +4458,7 @@ const deserializeAws_restJson1StopMonitoringMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4499,7 +4499,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4540,7 +4540,7 @@ const deserializeAws_restJson1UnarchiveFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4581,7 +4581,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4622,7 +4622,7 @@ const deserializeAws_restJson1UpdateDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4666,7 +4666,7 @@ const deserializeAws_restJson1UpdateFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4707,7 +4707,7 @@ const deserializeAws_restJson1UpdateFindingsFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4748,7 +4748,7 @@ const deserializeAws_restJson1UpdateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4789,7 +4789,7 @@ const deserializeAws_restJson1UpdateMalwareScanSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4833,7 +4833,7 @@ const deserializeAws_restJson1UpdateMemberDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4874,7 +4874,7 @@ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4915,7 +4915,7 @@ const deserializeAws_restJson1UpdatePublishingDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4956,7 +4956,7 @@ const deserializeAws_restJson1UpdateThreatIntelSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7264,6 +7264,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-health/src/protocols/Aws_json1_1.ts b/clients/client-health/src/protocols/Aws_json1_1.ts index e164b9cc5bac..d492eebe35ba 100644 --- a/clients/client-health/src/protocols/Aws_json1_1.ts +++ b/clients/client-health/src/protocols/Aws_json1_1.ts @@ -300,7 +300,7 @@ const deserializeAws_json1_1DescribeAffectedAccountsForOrganizationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -341,7 +341,7 @@ const deserializeAws_json1_1DescribeAffectedEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -385,7 +385,7 @@ const deserializeAws_json1_1DescribeAffectedEntitiesForOrganizationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -429,7 +429,7 @@ const deserializeAws_json1_1DescribeEntityAggregatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -464,7 +464,7 @@ const deserializeAws_json1_1DescribeEventAggregatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -505,7 +505,7 @@ const deserializeAws_json1_1DescribeEventDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -546,7 +546,7 @@ const deserializeAws_json1_1DescribeEventDetailsForOrganizationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -587,7 +587,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -631,7 +631,7 @@ const deserializeAws_json1_1DescribeEventsForOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -675,7 +675,7 @@ const deserializeAws_json1_1DescribeEventTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -719,7 +719,7 @@ const deserializeAws_json1_1DescribeHealthServiceStatusForOrganizationCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -751,7 +751,7 @@ const deserializeAws_json1_1DisableHealthServiceAccessForOrganizationCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -789,7 +789,7 @@ const deserializeAws_json1_1EnableHealthServiceAccessForOrganizationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1769,6 +1769,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-healthlake/src/protocols/Aws_json1_0.ts b/clients/client-healthlake/src/protocols/Aws_json1_0.ts index ccc4a9cbdc5c..63a9ac2e5953 100644 --- a/clients/client-healthlake/src/protocols/Aws_json1_0.ts +++ b/clients/client-healthlake/src/protocols/Aws_json1_0.ts @@ -287,7 +287,7 @@ const deserializeAws_json1_0CreateFHIRDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -337,7 +337,7 @@ const deserializeAws_json1_0DeleteFHIRDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -393,7 +393,7 @@ const deserializeAws_json1_0DescribeFHIRDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -443,7 +443,7 @@ const deserializeAws_json1_0DescribeFHIRExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -493,7 +493,7 @@ const deserializeAws_json1_0DescribeFHIRImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -543,7 +543,7 @@ const deserializeAws_json1_0ListFHIRDatastoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -590,7 +590,7 @@ const deserializeAws_json1_0ListFHIRExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -643,7 +643,7 @@ const deserializeAws_json1_0ListFHIRImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -696,7 +696,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -740,7 +740,7 @@ const deserializeAws_json1_0StartFHIRExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -793,7 +793,7 @@ const deserializeAws_json1_0StartFHIRImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -846,7 +846,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -890,7 +890,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1611,6 +1611,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-honeycode/src/protocols/Aws_restJson1.ts b/clients/client-honeycode/src/protocols/Aws_restJson1.ts index 7b8ddf1b1552..06c5cbba316e 100644 --- a/clients/client-honeycode/src/protocols/Aws_restJson1.ts +++ b/clients/client-honeycode/src/protocols/Aws_restJson1.ts @@ -563,7 +563,7 @@ const deserializeAws_restJson1BatchCreateTableRowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -628,7 +628,7 @@ const deserializeAws_restJson1BatchDeleteTableRowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -690,7 +690,7 @@ const deserializeAws_restJson1BatchUpdateTableRowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -755,7 +755,7 @@ const deserializeAws_restJson1BatchUpsertTableRowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -826,7 +826,7 @@ const deserializeAws_restJson1DescribeTableDataImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -891,7 +891,7 @@ const deserializeAws_restJson1GetScreenDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -950,7 +950,7 @@ const deserializeAws_restJson1InvokeScreenAutomationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1024,7 +1024,7 @@ const deserializeAws_restJson1ListTableColumnsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1095,7 +1095,7 @@ const deserializeAws_restJson1ListTableRowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1160,7 +1160,7 @@ const deserializeAws_restJson1ListTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1219,7 +1219,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1287,7 +1287,7 @@ const deserializeAws_restJson1QueryTableRowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1349,7 +1349,7 @@ const deserializeAws_restJson1StartTableDataImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1408,7 +1408,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1464,7 +1464,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2247,6 +2247,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iam/src/protocols/Aws_query.ts b/clients/client-iam/src/protocols/Aws_query.ts index 97413661b6da..e1e18556c9bf 100644 --- a/clients/client-iam/src/protocols/Aws_query.ts +++ b/clients/client-iam/src/protocols/Aws_query.ts @@ -3264,7 +3264,7 @@ const deserializeAws_queryAddClientIDToOpenIDConnectProviderCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3311,7 +3311,7 @@ const deserializeAws_queryAddRoleToInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3361,7 +3361,7 @@ const deserializeAws_queryAddUserToGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3405,7 +3405,7 @@ const deserializeAws_queryAttachGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3455,7 +3455,7 @@ const deserializeAws_queryAttachRolePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3508,7 +3508,7 @@ const deserializeAws_queryAttachUserPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3558,7 +3558,7 @@ const deserializeAws_queryChangePasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3614,7 +3614,7 @@ const deserializeAws_queryCreateAccessKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3658,7 +3658,7 @@ const deserializeAws_queryCreateAccountAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3705,7 +3705,7 @@ const deserializeAws_queryCreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3755,7 +3755,7 @@ const deserializeAws_queryCreateInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3808,7 +3808,7 @@ const deserializeAws_queryCreateLoginProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3861,7 +3861,7 @@ const deserializeAws_queryCreateOpenIDConnectProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3914,7 +3914,7 @@ const deserializeAws_queryCreatePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3970,7 +3970,7 @@ const deserializeAws_queryCreatePolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4023,7 +4023,7 @@ const deserializeAws_queryCreateRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4079,7 +4079,7 @@ const deserializeAws_queryCreateSAMLProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4132,7 +4132,7 @@ const deserializeAws_queryCreateServiceLinkedRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4185,7 +4185,7 @@ const deserializeAws_queryCreateServiceSpecificCredentialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4232,7 +4232,7 @@ const deserializeAws_queryCreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4288,7 +4288,7 @@ const deserializeAws_queryCreateVirtualMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4338,7 +4338,7 @@ const deserializeAws_queryDeactivateMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4385,7 +4385,7 @@ const deserializeAws_queryDeleteAccessKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4429,7 +4429,7 @@ const deserializeAws_queryDeleteAccountAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4473,7 +4473,7 @@ const deserializeAws_queryDeleteAccountPasswordPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4517,7 +4517,7 @@ const deserializeAws_queryDeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4564,7 +4564,7 @@ const deserializeAws_queryDeleteGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4608,7 +4608,7 @@ const deserializeAws_queryDeleteInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4655,7 +4655,7 @@ const deserializeAws_queryDeleteLoginProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4702,7 +4702,7 @@ const deserializeAws_queryDeleteOpenIDConnectProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4746,7 +4746,7 @@ const deserializeAws_queryDeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4796,7 +4796,7 @@ const deserializeAws_queryDeletePolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4846,7 +4846,7 @@ const deserializeAws_queryDeleteRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4899,7 +4899,7 @@ const deserializeAws_queryDeleteRolePermissionsBoundaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4943,7 +4943,7 @@ const deserializeAws_queryDeleteRolePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4990,7 +4990,7 @@ const deserializeAws_queryDeleteSAMLProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5037,7 +5037,7 @@ const deserializeAws_queryDeleteServerCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5087,7 +5087,7 @@ const deserializeAws_queryDeleteServiceLinkedRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5131,7 +5131,7 @@ const deserializeAws_queryDeleteServiceSpecificCredentialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5169,7 +5169,7 @@ const deserializeAws_queryDeleteSigningCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5213,7 +5213,7 @@ const deserializeAws_queryDeleteSSHPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5251,7 +5251,7 @@ const deserializeAws_queryDeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5301,7 +5301,7 @@ const deserializeAws_queryDeleteUserPermissionsBoundaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5342,7 +5342,7 @@ const deserializeAws_queryDeleteUserPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5386,7 +5386,7 @@ const deserializeAws_queryDeleteVirtualMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5433,7 +5433,7 @@ const deserializeAws_queryDetachGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5480,7 +5480,7 @@ const deserializeAws_queryDetachRolePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5530,7 +5530,7 @@ const deserializeAws_queryDetachUserPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5577,7 +5577,7 @@ const deserializeAws_queryEnableMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5633,7 +5633,7 @@ const deserializeAws_queryGenerateCredentialReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5680,7 +5680,7 @@ const deserializeAws_queryGenerateOrganizationsAccessReportCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5724,7 +5724,7 @@ const deserializeAws_queryGenerateServiceLastAccessedDetailsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5768,7 +5768,7 @@ const deserializeAws_queryGetAccessKeyLastUsedCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5812,7 +5812,7 @@ const deserializeAws_queryGetAccountAuthorizationDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5853,7 +5853,7 @@ const deserializeAws_queryGetAccountPasswordPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5897,7 +5897,7 @@ const deserializeAws_queryGetAccountSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5938,7 +5938,7 @@ const deserializeAws_queryGetContextKeysForCustomPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5979,7 +5979,7 @@ const deserializeAws_queryGetContextKeysForPrincipalPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6023,7 +6023,7 @@ const deserializeAws_queryGetCredentialReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6073,7 +6073,7 @@ const deserializeAws_queryGetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6117,7 +6117,7 @@ const deserializeAws_queryGetGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6161,7 +6161,7 @@ const deserializeAws_queryGetInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6205,7 +6205,7 @@ const deserializeAws_queryGetLoginProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6249,7 +6249,7 @@ const deserializeAws_queryGetOpenIDConnectProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6296,7 +6296,7 @@ const deserializeAws_queryGetOrganizationsAccessReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6337,7 +6337,7 @@ const deserializeAws_queryGetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6384,7 +6384,7 @@ const deserializeAws_queryGetPolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6431,7 +6431,7 @@ const deserializeAws_queryGetRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6475,7 +6475,7 @@ const deserializeAws_queryGetRolePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6519,7 +6519,7 @@ const deserializeAws_queryGetSAMLProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6566,7 +6566,7 @@ const deserializeAws_queryGetServerCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6613,7 +6613,7 @@ const deserializeAws_queryGetServiceLastAccessedDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6660,7 +6660,7 @@ const deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6707,7 +6707,7 @@ const deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6754,7 +6754,7 @@ const deserializeAws_queryGetSSHPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6798,7 +6798,7 @@ const deserializeAws_queryGetUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6842,7 +6842,7 @@ const deserializeAws_queryGetUserPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6886,7 +6886,7 @@ const deserializeAws_queryListAccessKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6930,7 +6930,7 @@ const deserializeAws_queryListAccountAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6971,7 +6971,7 @@ const deserializeAws_queryListAttachedGroupPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7018,7 +7018,7 @@ const deserializeAws_queryListAttachedRolePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7065,7 +7065,7 @@ const deserializeAws_queryListAttachedUserPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7112,7 +7112,7 @@ const deserializeAws_queryListEntitiesForPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7159,7 +7159,7 @@ const deserializeAws_queryListGroupPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7203,7 +7203,7 @@ const deserializeAws_queryListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7244,7 +7244,7 @@ const deserializeAws_queryListGroupsForUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7288,7 +7288,7 @@ const deserializeAws_queryListInstanceProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7329,7 +7329,7 @@ const deserializeAws_queryListInstanceProfilesForRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7373,7 +7373,7 @@ const deserializeAws_queryListInstanceProfileTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7417,7 +7417,7 @@ const deserializeAws_queryListMFADevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7461,7 +7461,7 @@ const deserializeAws_queryListMFADeviceTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7508,7 +7508,7 @@ const deserializeAws_queryListOpenIDConnectProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7552,7 +7552,7 @@ const deserializeAws_queryListOpenIDConnectProviderTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7599,7 +7599,7 @@ const deserializeAws_queryListPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7643,7 +7643,7 @@ const deserializeAws_queryListPoliciesGrantingServiceAccessCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7687,7 +7687,7 @@ const deserializeAws_queryListPolicyTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7734,7 +7734,7 @@ const deserializeAws_queryListPolicyVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7781,7 +7781,7 @@ const deserializeAws_queryListRolePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7825,7 +7825,7 @@ const deserializeAws_queryListRolesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7866,7 +7866,7 @@ const deserializeAws_queryListRoleTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7910,7 +7910,7 @@ const deserializeAws_queryListSAMLProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7951,7 +7951,7 @@ const deserializeAws_queryListSAMLProviderTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7998,7 +7998,7 @@ const deserializeAws_queryListServerCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8039,7 +8039,7 @@ const deserializeAws_queryListServerCertificateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8086,7 +8086,7 @@ const deserializeAws_queryListServiceSpecificCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8130,7 +8130,7 @@ const deserializeAws_queryListSigningCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8174,7 +8174,7 @@ const deserializeAws_queryListSSHPublicKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8215,7 +8215,7 @@ const deserializeAws_queryListUserPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8259,7 +8259,7 @@ const deserializeAws_queryListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8300,7 +8300,7 @@ const deserializeAws_queryListUserTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8344,7 +8344,7 @@ const deserializeAws_queryListVirtualMFADevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8376,7 +8376,7 @@ const deserializeAws_queryPutGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8423,7 +8423,7 @@ const deserializeAws_queryPutRolePermissionsBoundaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8473,7 +8473,7 @@ const deserializeAws_queryPutRolePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8523,7 +8523,7 @@ const deserializeAws_queryPutUserPermissionsBoundaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8570,7 +8570,7 @@ const deserializeAws_queryPutUserPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8617,7 +8617,7 @@ const deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8661,7 +8661,7 @@ const deserializeAws_queryRemoveRoleFromInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8708,7 +8708,7 @@ const deserializeAws_queryRemoveUserFromGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8758,7 +8758,7 @@ const deserializeAws_queryResetServiceSpecificCredentialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8796,7 +8796,7 @@ const deserializeAws_queryResyncMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8843,7 +8843,7 @@ const deserializeAws_querySetDefaultPolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8890,7 +8890,7 @@ const deserializeAws_querySetSecurityTokenServicePreferencesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8931,7 +8931,7 @@ const deserializeAws_querySimulateCustomPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8975,7 +8975,7 @@ const deserializeAws_querySimulatePrincipalPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9019,7 +9019,7 @@ const deserializeAws_queryTagInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9069,7 +9069,7 @@ const deserializeAws_queryTagMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9119,7 +9119,7 @@ const deserializeAws_queryTagOpenIDConnectProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9169,7 +9169,7 @@ const deserializeAws_queryTagPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9219,7 +9219,7 @@ const deserializeAws_queryTagRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9269,7 +9269,7 @@ const deserializeAws_queryTagSAMLProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9319,7 +9319,7 @@ const deserializeAws_queryTagServerCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9369,7 +9369,7 @@ const deserializeAws_queryTagUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9419,7 +9419,7 @@ const deserializeAws_queryUntagInstanceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9466,7 +9466,7 @@ const deserializeAws_queryUntagMFADeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9513,7 +9513,7 @@ const deserializeAws_queryUntagOpenIDConnectProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9560,7 +9560,7 @@ const deserializeAws_queryUntagPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9607,7 +9607,7 @@ const deserializeAws_queryUntagRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9651,7 +9651,7 @@ const deserializeAws_queryUntagSAMLProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9698,7 +9698,7 @@ const deserializeAws_queryUntagServerCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9745,7 +9745,7 @@ const deserializeAws_queryUntagUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9789,7 +9789,7 @@ const deserializeAws_queryUpdateAccessKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9833,7 +9833,7 @@ const deserializeAws_queryUpdateAccountPasswordPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9880,7 +9880,7 @@ const deserializeAws_queryUpdateAssumeRolePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9930,7 +9930,7 @@ const deserializeAws_queryUpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9977,7 +9977,7 @@ const deserializeAws_queryUpdateLoginProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10027,7 +10027,7 @@ const deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10074,7 +10074,7 @@ const deserializeAws_queryUpdateRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10121,7 +10121,7 @@ const deserializeAws_queryUpdateRoleDescriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10168,7 +10168,7 @@ const deserializeAws_queryUpdateSAMLProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10215,7 +10215,7 @@ const deserializeAws_queryUpdateServerCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10262,7 +10262,7 @@ const deserializeAws_queryUpdateServiceSpecificCredentialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10300,7 +10300,7 @@ const deserializeAws_queryUpdateSigningCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10344,7 +10344,7 @@ const deserializeAws_queryUpdateSSHPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10382,7 +10382,7 @@ const deserializeAws_queryUpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10438,7 +10438,7 @@ const deserializeAws_queryUploadServerCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10497,7 +10497,7 @@ const deserializeAws_queryUploadSigningCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10556,7 +10556,7 @@ const deserializeAws_queryUploadSSHPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17393,6 +17393,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-identitystore/src/protocols/Aws_json1_1.ts b/clients/client-identitystore/src/protocols/Aws_json1_1.ts index 2dc778f04b76..2d02634d2974 100644 --- a/clients/client-identitystore/src/protocols/Aws_json1_1.ts +++ b/clients/client-identitystore/src/protocols/Aws_json1_1.ts @@ -386,7 +386,7 @@ const deserializeAws_json1_1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -445,7 +445,7 @@ const deserializeAws_json1_1CreateGroupMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -504,7 +504,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -563,7 +563,7 @@ const deserializeAws_json1_1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -619,7 +619,7 @@ const deserializeAws_json1_1DeleteGroupMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -675,7 +675,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -731,7 +731,7 @@ const deserializeAws_json1_1DescribeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -784,7 +784,7 @@ const deserializeAws_json1_1DescribeGroupMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -837,7 +837,7 @@ const deserializeAws_json1_1DescribeUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -890,7 +890,7 @@ const deserializeAws_json1_1GetGroupIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -943,7 +943,7 @@ const deserializeAws_json1_1GetGroupMembershipIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -996,7 +996,7 @@ const deserializeAws_json1_1GetUserIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1049,7 +1049,7 @@ const deserializeAws_json1_1IsMemberInGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1102,7 +1102,7 @@ const deserializeAws_json1_1ListGroupMembershipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1155,7 +1155,7 @@ const deserializeAws_json1_1ListGroupMembershipsForMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1208,7 +1208,7 @@ const deserializeAws_json1_1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1261,7 +1261,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1314,7 +1314,7 @@ const deserializeAws_json1_1UpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1373,7 +1373,7 @@ const deserializeAws_json1_1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2314,6 +2314,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts index e86c32abeb6a..c6506fba815c 100644 --- a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts @@ -1651,7 +1651,7 @@ const deserializeAws_restJson1CancelImageCreationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1719,7 +1719,7 @@ const deserializeAws_restJson1CreateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1796,7 +1796,7 @@ const deserializeAws_restJson1CreateContainerRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1873,7 +1873,7 @@ const deserializeAws_restJson1CreateDistributionConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1950,7 +1950,7 @@ const deserializeAws_restJson1CreateImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2021,7 +2021,7 @@ const deserializeAws_restJson1CreateImagePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2095,7 +2095,7 @@ const deserializeAws_restJson1CreateImageRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2172,7 +2172,7 @@ const deserializeAws_restJson1CreateInfrastructureConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2243,7 +2243,7 @@ const deserializeAws_restJson1DeleteComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2305,7 +2305,7 @@ const deserializeAws_restJson1DeleteContainerRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2367,7 +2367,7 @@ const deserializeAws_restJson1DeleteDistributionConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1DeleteImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2491,7 +2491,7 @@ const deserializeAws_restJson1DeleteImagePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2553,7 +2553,7 @@ const deserializeAws_restJson1DeleteImageRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2615,7 +2615,7 @@ const deserializeAws_restJson1DeleteInfrastructureConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2677,7 +2677,7 @@ const deserializeAws_restJson1GetComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2736,7 +2736,7 @@ const deserializeAws_restJson1GetComponentPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2795,7 +2795,7 @@ const deserializeAws_restJson1GetContainerRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2854,7 +2854,7 @@ const deserializeAws_restJson1GetContainerRecipePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2916,7 +2916,7 @@ const deserializeAws_restJson1GetDistributionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2975,7 +2975,7 @@ const deserializeAws_restJson1GetImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3034,7 +3034,7 @@ const deserializeAws_restJson1GetImagePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3093,7 +3093,7 @@ const deserializeAws_restJson1GetImagePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3152,7 +3152,7 @@ const deserializeAws_restJson1GetImageRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3211,7 +3211,7 @@ const deserializeAws_restJson1GetImageRecipePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3273,7 +3273,7 @@ const deserializeAws_restJson1GetInfrastructureConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3335,7 +3335,7 @@ const deserializeAws_restJson1ImportComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3409,7 +3409,7 @@ const deserializeAws_restJson1ImportVmImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3462,7 +3462,7 @@ const deserializeAws_restJson1ListComponentBuildVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3527,7 +3527,7 @@ const deserializeAws_restJson1ListComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3595,7 +3595,7 @@ const deserializeAws_restJson1ListContainerRecipesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3663,7 +3663,7 @@ const deserializeAws_restJson1ListDistributionConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3728,7 +3728,7 @@ const deserializeAws_restJson1ListImageBuildVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3793,7 +3793,7 @@ const deserializeAws_restJson1ListImagePackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3861,7 +3861,7 @@ const deserializeAws_restJson1ListImagePipelineImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3929,7 +3929,7 @@ const deserializeAws_restJson1ListImagePipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3997,7 +3997,7 @@ const deserializeAws_restJson1ListImageRecipesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4062,7 +4062,7 @@ const deserializeAws_restJson1ListImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4130,7 +4130,7 @@ const deserializeAws_restJson1ListInfrastructureConfigurationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4189,7 +4189,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4239,7 +4239,7 @@ const deserializeAws_restJson1PutComponentPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4304,7 +4304,7 @@ const deserializeAws_restJson1PutContainerRecipePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4369,7 +4369,7 @@ const deserializeAws_restJson1PutImagePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4434,7 +4434,7 @@ const deserializeAws_restJson1PutImageRecipePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4502,7 +4502,7 @@ const deserializeAws_restJson1StartImagePipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4564,7 +4564,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4608,7 +4608,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4661,7 +4661,7 @@ const deserializeAws_restJson1UpdateDistributionConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4732,7 +4732,7 @@ const deserializeAws_restJson1UpdateImagePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4800,7 +4800,7 @@ const deserializeAws_restJson1UpdateInfrastructureConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6666,6 +6666,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-inspector/src/protocols/Aws_json1_1.ts b/clients/client-inspector/src/protocols/Aws_json1_1.ts index 26a26cd08ce4..9a8dd8b48160 100644 --- a/clients/client-inspector/src/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/src/protocols/Aws_json1_1.ts @@ -753,7 +753,7 @@ const deserializeAws_json1_1AddAttributesToFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -806,7 +806,7 @@ const deserializeAws_json1_1CreateAssessmentTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -865,7 +865,7 @@ const deserializeAws_json1_1CreateAssessmentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -921,7 +921,7 @@ const deserializeAws_json1_1CreateExclusionsPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -977,7 +977,7 @@ const deserializeAws_json1_1CreateResourceGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1027,7 +1027,7 @@ const deserializeAws_json1_1DeleteAssessmentRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1080,7 +1080,7 @@ const deserializeAws_json1_1DeleteAssessmentTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1133,7 +1133,7 @@ const deserializeAws_json1_1DeleteAssessmentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1189,7 +1189,7 @@ const deserializeAws_json1_1DescribeAssessmentRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1233,7 +1233,7 @@ const deserializeAws_json1_1DescribeAssessmentTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1277,7 +1277,7 @@ const deserializeAws_json1_1DescribeAssessmentTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1321,7 +1321,7 @@ const deserializeAws_json1_1DescribeCrossAccountAccessRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1362,7 +1362,7 @@ const deserializeAws_json1_1DescribeExclusionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1406,7 +1406,7 @@ const deserializeAws_json1_1DescribeFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1450,7 +1450,7 @@ const deserializeAws_json1_1DescribeResourceGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1494,7 +1494,7 @@ const deserializeAws_json1_1DescribeRulesPackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_json1_1GetAssessmentReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1597,7 +1597,7 @@ const deserializeAws_json1_1GetExclusionsPreviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1647,7 +1647,7 @@ const deserializeAws_json1_1GetTelemetryMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1697,7 +1697,7 @@ const deserializeAws_json1_1ListAssessmentRunAgentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1747,7 +1747,7 @@ const deserializeAws_json1_1ListAssessmentRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1797,7 +1797,7 @@ const deserializeAws_json1_1ListAssessmentTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1844,7 +1844,7 @@ const deserializeAws_json1_1ListAssessmentTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1894,7 +1894,7 @@ const deserializeAws_json1_1ListEventSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1944,7 +1944,7 @@ const deserializeAws_json1_1ListExclusionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1994,7 +1994,7 @@ const deserializeAws_json1_1ListFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2044,7 +2044,7 @@ const deserializeAws_json1_1ListRulesPackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2091,7 +2091,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2141,7 +2141,7 @@ const deserializeAws_json1_1PreviewAgentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2191,7 +2191,7 @@ const deserializeAws_json1_1RegisterCrossAccountAccessRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2244,7 +2244,7 @@ const deserializeAws_json1_1RemoveAttributesFromFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2294,7 +2294,7 @@ const deserializeAws_json1_1SetTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2347,7 +2347,7 @@ const deserializeAws_json1_1StartAssessmentRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2406,7 +2406,7 @@ const deserializeAws_json1_1StopAssessmentRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2456,7 +2456,7 @@ const deserializeAws_json1_1SubscribeToEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2509,7 +2509,7 @@ const deserializeAws_json1_1UnsubscribeFromEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2559,7 +2559,7 @@ const deserializeAws_json1_1UpdateAssessmentTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4607,6 +4607,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-inspector2/src/protocols/Aws_restJson1.ts b/clients/client-inspector2/src/protocols/Aws_restJson1.ts index 4c5edaa3ae1c..6d146aba09c7 100644 --- a/clients/client-inspector2/src/protocols/Aws_restJson1.ts +++ b/clients/client-inspector2/src/protocols/Aws_restJson1.ts @@ -1054,7 +1054,7 @@ const deserializeAws_restJson1AssociateMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1107,7 +1107,7 @@ const deserializeAws_restJson1BatchGetAccountStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1163,7 +1163,7 @@ const deserializeAws_restJson1BatchGetFreeTrialInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1213,7 +1213,7 @@ const deserializeAws_restJson1CancelFindingsReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1266,7 +1266,7 @@ const deserializeAws_restJson1CreateFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1322,7 +1322,7 @@ const deserializeAws_restJson1CreateFindingsReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1375,7 +1375,7 @@ const deserializeAws_restJson1DeleteFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1431,7 +1431,7 @@ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1484,7 +1484,7 @@ const deserializeAws_restJson1DisableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1537,7 +1537,7 @@ const deserializeAws_restJson1DisableDelegatedAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1593,7 +1593,7 @@ const deserializeAws_restJson1DisassociateMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1646,7 +1646,7 @@ const deserializeAws_restJson1EnableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1699,7 +1699,7 @@ const deserializeAws_restJson1EnableDelegatedAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1755,7 +1755,7 @@ const deserializeAws_restJson1GetConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1802,7 +1802,7 @@ const deserializeAws_restJson1GetDelegatedAdminAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1870,7 +1870,7 @@ const deserializeAws_restJson1GetFindingsReportStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1923,7 +1923,7 @@ const deserializeAws_restJson1GetMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1979,7 +1979,7 @@ const deserializeAws_restJson1ListAccountPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2032,7 +2032,7 @@ const deserializeAws_restJson1ListCoverageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2085,7 +2085,7 @@ const deserializeAws_restJson1ListCoverageStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2138,7 +2138,7 @@ const deserializeAws_restJson1ListDelegatedAdminAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2191,7 +2191,7 @@ const deserializeAws_restJson1ListFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2247,7 +2247,7 @@ const deserializeAws_restJson1ListFindingAggregationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2297,7 +2297,7 @@ const deserializeAws_restJson1ListFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2347,7 +2347,7 @@ const deserializeAws_restJson1ListMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2397,7 +2397,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2450,7 +2450,7 @@ const deserializeAws_restJson1ListUsageTotalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2497,7 +2497,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2547,7 +2547,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2594,7 +2594,7 @@ const deserializeAws_restJson1UpdateConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2644,7 +2644,7 @@ const deserializeAws_restJson1UpdateFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2697,7 +2697,7 @@ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4697,6 +4697,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts index 20a8efe83ba1..9d77e264d0b4 100644 --- a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts @@ -398,7 +398,7 @@ const deserializeAws_restJson1ClaimDevicesByClaimCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -445,7 +445,7 @@ const deserializeAws_restJson1DescribeDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -492,7 +492,7 @@ const deserializeAws_restJson1FinalizeDeviceClaimCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -545,7 +545,7 @@ const deserializeAws_restJson1GetDeviceMethodsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -592,7 +592,7 @@ const deserializeAws_restJson1InitiateDeviceClaimCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -642,7 +642,7 @@ const deserializeAws_restJson1InvokeDeviceMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -701,7 +701,7 @@ const deserializeAws_restJson1ListDeviceEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -754,7 +754,7 @@ const deserializeAws_restJson1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -801,7 +801,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -842,7 +842,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -889,7 +889,7 @@ const deserializeAws_restJson1UnclaimDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -933,7 +933,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -977,7 +977,7 @@ const deserializeAws_restJson1UpdateDeviceStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1290,6 +1290,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts index 8f4fa4101e89..2f5e6fae8390 100644 --- a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts @@ -534,7 +534,7 @@ const deserializeAws_restJson1AssociateDeviceWithPlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -581,7 +581,7 @@ const deserializeAws_restJson1CreatePlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -628,7 +628,7 @@ const deserializeAws_restJson1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -672,7 +672,7 @@ const deserializeAws_restJson1DeletePlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -719,7 +719,7 @@ const deserializeAws_restJson1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -769,7 +769,7 @@ const deserializeAws_restJson1DescribePlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -816,7 +816,7 @@ const deserializeAws_restJson1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -860,7 +860,7 @@ const deserializeAws_restJson1DisassociateDeviceFromPlacementCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -910,7 +910,7 @@ const deserializeAws_restJson1GetDevicesInPlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -960,7 +960,7 @@ const deserializeAws_restJson1ListPlacementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1010,7 +1010,7 @@ const deserializeAws_restJson1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1054,7 +1054,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1098,7 +1098,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1142,7 +1142,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1186,7 +1186,7 @@ const deserializeAws_restJson1UpdatePlacementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1233,7 +1233,7 @@ const deserializeAws_restJson1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1679,6 +1679,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts index 566eeff60f14..f2e912b00688 100644 --- a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts @@ -248,7 +248,7 @@ const deserializeAws_restJson1DeleteThingShadowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -319,7 +319,7 @@ const deserializeAws_restJson1GetRetainedMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -376,7 +376,7 @@ const deserializeAws_restJson1GetThingShadowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -444,7 +444,7 @@ const deserializeAws_restJson1ListNamedShadowsForThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -506,7 +506,7 @@ const deserializeAws_restJson1ListRetainedMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -559,7 +559,7 @@ const deserializeAws_restJson1PublishCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -607,7 +607,7 @@ const deserializeAws_restJson1UpdateThingShadowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -883,6 +883,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts index e875b5b83b07..4810046e5fb6 100644 --- a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts @@ -446,7 +446,7 @@ const deserializeAws_restJson1BatchAcknowledgeAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -499,7 +499,7 @@ const deserializeAws_restJson1BatchDeleteDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -549,7 +549,7 @@ const deserializeAws_restJson1BatchDisableAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -599,7 +599,7 @@ const deserializeAws_restJson1BatchEnableAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -652,7 +652,7 @@ const deserializeAws_restJson1BatchPutMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -702,7 +702,7 @@ const deserializeAws_restJson1BatchResetAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -752,7 +752,7 @@ const deserializeAws_restJson1BatchSnoozeAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -805,7 +805,7 @@ const deserializeAws_restJson1BatchUpdateDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -855,7 +855,7 @@ const deserializeAws_restJson1DescribeAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -908,7 +908,7 @@ const deserializeAws_restJson1DescribeDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -964,7 +964,7 @@ const deserializeAws_restJson1ListAlarmsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1020,7 +1020,7 @@ const deserializeAws_restJson1ListDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1752,6 +1752,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-events/src/protocols/Aws_restJson1.ts b/clients/client-iot-events/src/protocols/Aws_restJson1.ts index 6d12cac414f2..12da0b33ee63 100644 --- a/clients/client-iot-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events/src/protocols/Aws_restJson1.ts @@ -925,7 +925,7 @@ const deserializeAws_restJson1CreateAlarmModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -987,7 +987,7 @@ const deserializeAws_restJson1CreateDetectorModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1046,7 +1046,7 @@ const deserializeAws_restJson1CreateInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1096,7 +1096,7 @@ const deserializeAws_restJson1DeleteAlarmModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1149,7 +1149,7 @@ const deserializeAws_restJson1DeleteDetectorModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1202,7 +1202,7 @@ const deserializeAws_restJson1DeleteInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1300,7 +1300,7 @@ const deserializeAws_restJson1DescribeAlarmModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1353,7 +1353,7 @@ const deserializeAws_restJson1DescribeDetectorModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1406,7 +1406,7 @@ const deserializeAws_restJson1DescribeDetectorModelAnalysisCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1459,7 +1459,7 @@ const deserializeAws_restJson1DescribeInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1512,7 +1512,7 @@ const deserializeAws_restJson1DescribeLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1571,7 +1571,7 @@ const deserializeAws_restJson1GetDetectorModelAnalysisResultsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1627,7 +1627,7 @@ const deserializeAws_restJson1ListAlarmModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1683,7 +1683,7 @@ const deserializeAws_restJson1ListAlarmModelVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1742,7 +1742,7 @@ const deserializeAws_restJson1ListDetectorModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1798,7 +1798,7 @@ const deserializeAws_restJson1ListDetectorModelVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1854,7 +1854,7 @@ const deserializeAws_restJson1ListInputRoutingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1910,7 +1910,7 @@ const deserializeAws_restJson1ListInputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1960,7 +1960,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2010,7 +2010,7 @@ const deserializeAws_restJson1PutLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2066,7 +2066,7 @@ const deserializeAws_restJson1StartDetectorModelAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2116,7 +2116,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2169,7 +2169,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2234,7 +2234,7 @@ const deserializeAws_restJson1UpdateAlarmModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2293,7 +2293,7 @@ const deserializeAws_restJson1UpdateDetectorModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2349,7 +2349,7 @@ const deserializeAws_restJson1UpdateInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3948,6 +3948,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts index afe18b5733d1..6488177265a8 100644 --- a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts @@ -178,7 +178,7 @@ const deserializeAws_restJson1DescribeJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -237,7 +237,7 @@ const deserializeAws_restJson1GetPendingJobExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -290,7 +290,7 @@ const deserializeAws_restJson1StartNextPendingJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -346,7 +346,7 @@ const deserializeAws_restJson1UpdateJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -605,6 +605,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts index e982c791f891..0a60f4557c2b 100644 --- a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts @@ -3099,7 +3099,7 @@ const deserializeAws_restJson1AssociateAwsAccountWithPartnerAccountCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3152,7 +3152,7 @@ const deserializeAws_restJson1AssociateMulticastGroupWithFuotaTaskCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3205,7 +3205,7 @@ const deserializeAws_restJson1AssociateWirelessDeviceWithFuotaTaskCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3258,7 +3258,7 @@ const deserializeAws_restJson1AssociateWirelessDeviceWithMulticastGroupCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3311,7 +3311,7 @@ const deserializeAws_restJson1AssociateWirelessDeviceWithThingCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3367,7 +3367,7 @@ const deserializeAws_restJson1AssociateWirelessGatewayWithCertificateCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3420,7 +3420,7 @@ const deserializeAws_restJson1AssociateWirelessGatewayWithThingCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3473,7 +3473,7 @@ const deserializeAws_restJson1CancelMulticastGroupSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3532,7 +3532,7 @@ const deserializeAws_restJson1CreateDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3591,7 +3591,7 @@ const deserializeAws_restJson1CreateDeviceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3647,7 +3647,7 @@ const deserializeAws_restJson1CreateFuotaTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3706,7 +3706,7 @@ const deserializeAws_restJson1CreateMulticastGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3765,7 +3765,7 @@ const deserializeAws_restJson1CreateNetworkAnalyzerConfigurationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3824,7 +3824,7 @@ const deserializeAws_restJson1CreateServiceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3880,7 +3880,7 @@ const deserializeAws_restJson1CreateWirelessDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3939,7 +3939,7 @@ const deserializeAws_restJson1CreateWirelessGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3995,7 +3995,7 @@ const deserializeAws_restJson1CreateWirelessGatewayTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4054,7 +4054,7 @@ const deserializeAws_restJson1CreateWirelessGatewayTaskDefinitionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4107,7 +4107,7 @@ const deserializeAws_restJson1DeleteDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4160,7 +4160,7 @@ const deserializeAws_restJson1DeleteDeviceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4213,7 +4213,7 @@ const deserializeAws_restJson1DeleteFuotaTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4263,7 +4263,7 @@ const deserializeAws_restJson1DeleteMulticastGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4316,7 +4316,7 @@ const deserializeAws_restJson1DeleteNetworkAnalyzerConfigurationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4369,7 +4369,7 @@ const deserializeAws_restJson1DeleteQueuedMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4419,7 +4419,7 @@ const deserializeAws_restJson1DeleteServiceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4472,7 +4472,7 @@ const deserializeAws_restJson1DeleteWirelessDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4522,7 +4522,7 @@ const deserializeAws_restJson1DeleteWirelessGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4572,7 +4572,7 @@ const deserializeAws_restJson1DeleteWirelessGatewayTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4622,7 +4622,7 @@ const deserializeAws_restJson1DeleteWirelessGatewayTaskDefinitionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4672,7 +4672,7 @@ const deserializeAws_restJson1DisassociateAwsAccountFromPartnerAccountCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4719,7 +4719,7 @@ const deserializeAws_restJson1DisassociateMulticastGroupFromFuotaTaskCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4769,7 +4769,7 @@ const deserializeAws_restJson1DisassociateWirelessDeviceFromFuotaTaskCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4822,7 +4822,7 @@ const deserializeAws_restJson1DisassociateWirelessDeviceFromMulticastGroupComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4872,7 +4872,7 @@ const deserializeAws_restJson1DisassociateWirelessDeviceFromThingCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4925,7 +4925,7 @@ const deserializeAws_restJson1DisassociateWirelessGatewayFromCertificateCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4975,7 +4975,7 @@ const deserializeAws_restJson1DisassociateWirelessGatewayFromThingCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5046,7 +5046,7 @@ const deserializeAws_restJson1GetDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5108,7 +5108,7 @@ const deserializeAws_restJson1GetDeviceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5182,7 +5182,7 @@ const deserializeAws_restJson1GetEventConfigurationByResourceTypesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5253,7 +5253,7 @@ const deserializeAws_restJson1GetFuotaTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5318,7 +5318,7 @@ const deserializeAws_restJson1GetLogLevelsByResourceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5389,7 +5389,7 @@ const deserializeAws_restJson1GetMulticastGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5442,7 +5442,7 @@ const deserializeAws_restJson1GetMulticastGroupSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5510,7 +5510,7 @@ const deserializeAws_restJson1GetNetworkAnalyzerConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5566,7 +5566,7 @@ const deserializeAws_restJson1GetPartnerAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5631,7 +5631,7 @@ const deserializeAws_restJson1GetPositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5687,7 +5687,7 @@ const deserializeAws_restJson1GetPositionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5761,7 +5761,7 @@ const deserializeAws_restJson1GetResourceEventConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5814,7 +5814,7 @@ const deserializeAws_restJson1GetResourceLogLevelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5873,7 +5873,7 @@ const deserializeAws_restJson1GetServiceEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5932,7 +5932,7 @@ const deserializeAws_restJson1GetServiceProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6012,7 +6012,7 @@ const deserializeAws_restJson1GetWirelessDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6074,7 +6074,7 @@ const deserializeAws_restJson1GetWirelessDeviceStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6145,7 +6145,7 @@ const deserializeAws_restJson1GetWirelessGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6201,7 +6201,7 @@ const deserializeAws_restJson1GetWirelessGatewayCertificateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6254,7 +6254,7 @@ const deserializeAws_restJson1GetWirelessGatewayFirmwareInformationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6313,7 +6313,7 @@ const deserializeAws_restJson1GetWirelessGatewayStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6378,7 +6378,7 @@ const deserializeAws_restJson1GetWirelessGatewayTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6440,7 +6440,7 @@ const deserializeAws_restJson1GetWirelessGatewayTaskDefinitionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6496,7 +6496,7 @@ const deserializeAws_restJson1ListDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6549,7 +6549,7 @@ const deserializeAws_restJson1ListDeviceProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6605,7 +6605,7 @@ const deserializeAws_restJson1ListEventConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6658,7 +6658,7 @@ const deserializeAws_restJson1ListFuotaTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6711,7 +6711,7 @@ const deserializeAws_restJson1ListMulticastGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6767,7 +6767,7 @@ const deserializeAws_restJson1ListMulticastGroupsByFuotaTaskCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6826,7 +6826,7 @@ const deserializeAws_restJson1ListNetworkAnalyzerConfigurationsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6879,7 +6879,7 @@ const deserializeAws_restJson1ListPartnerAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6935,7 +6935,7 @@ const deserializeAws_restJson1ListPositionConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6991,7 +6991,7 @@ const deserializeAws_restJson1ListQueuedMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7047,7 +7047,7 @@ const deserializeAws_restJson1ListServiceProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7097,7 +7097,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7156,7 +7156,7 @@ const deserializeAws_restJson1ListWirelessDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7212,7 +7212,7 @@ const deserializeAws_restJson1ListWirelessGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7265,7 +7265,7 @@ const deserializeAws_restJson1ListWirelessGatewayTaskDefinitionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7312,7 +7312,7 @@ const deserializeAws_restJson1PutPositionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7362,7 +7362,7 @@ const deserializeAws_restJson1PutResourceLogLevelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7412,7 +7412,7 @@ const deserializeAws_restJson1ResetAllResourceLogLevelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7462,7 +7462,7 @@ const deserializeAws_restJson1ResetResourceLogLevelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7515,7 +7515,7 @@ const deserializeAws_restJson1SendDataToMulticastGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7571,7 +7571,7 @@ const deserializeAws_restJson1SendDataToWirelessDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7618,7 +7618,7 @@ const deserializeAws_restJson1StartBulkAssociateWirelessDeviceWithMulticastGroup ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7668,7 +7668,7 @@ const deserializeAws_restJson1StartBulkDisassociateWirelessDeviceFromMulticastGr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7718,7 +7718,7 @@ const deserializeAws_restJson1StartFuotaTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7771,7 +7771,7 @@ const deserializeAws_restJson1StartMulticastGroupSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7824,7 +7824,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7880,7 +7880,7 @@ const deserializeAws_restJson1TestWirelessDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7927,7 +7927,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7977,7 +7977,7 @@ const deserializeAws_restJson1UpdateDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8027,7 +8027,7 @@ const deserializeAws_restJson1UpdateEventConfigurationByResourceTypesCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8074,7 +8074,7 @@ const deserializeAws_restJson1UpdateFuotaTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8127,7 +8127,7 @@ const deserializeAws_restJson1UpdateLogLevelsByResourceTypesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8180,7 +8180,7 @@ const deserializeAws_restJson1UpdateMulticastGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8233,7 +8233,7 @@ const deserializeAws_restJson1UpdateNetworkAnalyzerConfigurationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8283,7 +8283,7 @@ const deserializeAws_restJson1UpdatePartnerAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8330,7 +8330,7 @@ const deserializeAws_restJson1UpdatePositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8380,7 +8380,7 @@ const deserializeAws_restJson1UpdateResourceEventConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8433,7 +8433,7 @@ const deserializeAws_restJson1UpdateWirelessDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8483,7 +8483,7 @@ const deserializeAws_restJson1UpdateWirelessGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10606,6 +10606,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iot/src/protocols/Aws_restJson1.ts b/clients/client-iot/src/protocols/Aws_restJson1.ts index e0d8a31ed5cf..b2cf27b5406e 100644 --- a/clients/client-iot/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot/src/protocols/Aws_restJson1.ts @@ -7676,7 +7676,7 @@ const deserializeAws_restJson1AcceptCertificateTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7732,7 +7732,7 @@ const deserializeAws_restJson1AddThingToBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7779,7 +7779,7 @@ const deserializeAws_restJson1AddThingToThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7835,7 +7835,7 @@ const deserializeAws_restJson1AssociateTargetsWithJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7885,7 +7885,7 @@ const deserializeAws_restJson1AttachPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7941,7 +7941,7 @@ const deserializeAws_restJson1AttachPrincipalPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7997,7 +7997,7 @@ const deserializeAws_restJson1AttachSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8050,7 +8050,7 @@ const deserializeAws_restJson1AttachThingPrincipalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8103,7 +8103,7 @@ const deserializeAws_restJson1CancelAuditMitigationActionsTaskCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8150,7 +8150,7 @@ const deserializeAws_restJson1CancelAuditTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8197,7 +8197,7 @@ const deserializeAws_restJson1CancelCertificateTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8253,7 +8253,7 @@ const deserializeAws_restJson1CancelDetectMitigationActionsTaskCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8309,7 +8309,7 @@ const deserializeAws_restJson1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8359,7 +8359,7 @@ const deserializeAws_restJson1CancelJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8412,7 +8412,7 @@ const deserializeAws_restJson1ClearDefaultAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8465,7 +8465,7 @@ const deserializeAws_restJson1ConfirmTopicRuleDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8515,7 +8515,7 @@ const deserializeAws_restJson1CreateAuditSuppressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8571,7 +8571,7 @@ const deserializeAws_restJson1CreateAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8636,7 +8636,7 @@ const deserializeAws_restJson1CreateBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8692,7 +8692,7 @@ const deserializeAws_restJson1CreateCertificateFromCsrCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8748,7 +8748,7 @@ const deserializeAws_restJson1CreateCustomMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8804,7 +8804,7 @@ const deserializeAws_restJson1CreateDimensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8860,7 +8860,7 @@ const deserializeAws_restJson1CreateDomainConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8937,7 +8937,7 @@ const deserializeAws_restJson1CreateDynamicThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8999,7 +8999,7 @@ const deserializeAws_restJson1CreateFleetMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9076,7 +9076,7 @@ const deserializeAws_restJson1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9135,7 +9135,7 @@ const deserializeAws_restJson1CreateJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9200,7 +9200,7 @@ const deserializeAws_restJson1CreateKeysAndCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9256,7 +9256,7 @@ const deserializeAws_restJson1CreateMitigationActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9321,7 +9321,7 @@ const deserializeAws_restJson1CreateOTAUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9392,7 +9392,7 @@ const deserializeAws_restJson1CreatePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9460,7 +9460,7 @@ const deserializeAws_restJson1CreatePolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9531,7 +9531,7 @@ const deserializeAws_restJson1CreateProvisioningClaimCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9593,7 +9593,7 @@ const deserializeAws_restJson1CreateProvisioningTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9658,7 +9658,7 @@ const deserializeAws_restJson1CreateProvisioningTemplateVersionCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9720,7 +9720,7 @@ const deserializeAws_restJson1CreateRoleAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9779,7 +9779,7 @@ const deserializeAws_restJson1CreateScheduledAuditCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9835,7 +9835,7 @@ const deserializeAws_restJson1CreateSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9894,7 +9894,7 @@ const deserializeAws_restJson1CreateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9962,7 +9962,7 @@ const deserializeAws_restJson1CreateThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10027,7 +10027,7 @@ const deserializeAws_restJson1CreateThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10083,7 +10083,7 @@ const deserializeAws_restJson1CreateThingTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10136,7 +10136,7 @@ const deserializeAws_restJson1CreateTopicRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10192,7 +10192,7 @@ const deserializeAws_restJson1CreateTopicRuleDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10242,7 +10242,7 @@ const deserializeAws_restJson1DeleteAccountAuditConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10289,7 +10289,7 @@ const deserializeAws_restJson1DeleteAuditSuppressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10333,7 +10333,7 @@ const deserializeAws_restJson1DeleteAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10389,7 +10389,7 @@ const deserializeAws_restJson1DeleteBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10436,7 +10436,7 @@ const deserializeAws_restJson1DeleteCACertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10492,7 +10492,7 @@ const deserializeAws_restJson1DeleteCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10551,7 +10551,7 @@ const deserializeAws_restJson1DeleteCustomMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10595,7 +10595,7 @@ const deserializeAws_restJson1DeleteDimensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10639,7 +10639,7 @@ const deserializeAws_restJson1DeleteDomainConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10692,7 +10692,7 @@ const deserializeAws_restJson1DeleteDynamicThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10739,7 +10739,7 @@ const deserializeAws_restJson1DeleteFleetMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10792,7 +10792,7 @@ const deserializeAws_restJson1DeleteJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10845,7 +10845,7 @@ const deserializeAws_restJson1DeleteJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10895,7 +10895,7 @@ const deserializeAws_restJson1DeleteJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10942,7 +10942,7 @@ const deserializeAws_restJson1DeleteMitigationActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10986,7 +10986,7 @@ const deserializeAws_restJson1DeleteOTAUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11042,7 +11042,7 @@ const deserializeAws_restJson1DeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11098,7 +11098,7 @@ const deserializeAws_restJson1DeletePolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11154,7 +11154,7 @@ const deserializeAws_restJson1DeleteProvisioningTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11210,7 +11210,7 @@ const deserializeAws_restJson1DeleteProvisioningTemplateVersionCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11266,7 +11266,7 @@ const deserializeAws_restJson1DeleteRegistrationCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11316,7 +11316,7 @@ const deserializeAws_restJson1DeleteRoleAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11372,7 +11372,7 @@ const deserializeAws_restJson1DeleteScheduledAuditCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11419,7 +11419,7 @@ const deserializeAws_restJson1DeleteSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11466,7 +11466,7 @@ const deserializeAws_restJson1DeleteStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11522,7 +11522,7 @@ const deserializeAws_restJson1DeleteThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11578,7 +11578,7 @@ const deserializeAws_restJson1DeleteThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11625,7 +11625,7 @@ const deserializeAws_restJson1DeleteThingTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11678,7 +11678,7 @@ const deserializeAws_restJson1DeleteTopicRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11728,7 +11728,7 @@ const deserializeAws_restJson1DeleteTopicRuleDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11778,7 +11778,7 @@ const deserializeAws_restJson1DeleteV2LoggingLevelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11822,7 +11822,7 @@ const deserializeAws_restJson1DeprecateThingTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11890,7 +11890,7 @@ const deserializeAws_restJson1DescribeAccountAuditConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11934,7 +11934,7 @@ const deserializeAws_restJson1DescribeAuditFindingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12008,7 +12008,7 @@ const deserializeAws_restJson1DescribeAuditMitigationActionsTaskCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12070,7 +12070,7 @@ const deserializeAws_restJson1DescribeAuditSuppressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12135,7 +12135,7 @@ const deserializeAws_restJson1DescribeAuditTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12185,7 +12185,7 @@ const deserializeAws_restJson1DescribeAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12259,7 +12259,7 @@ const deserializeAws_restJson1DescribeBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12315,7 +12315,7 @@ const deserializeAws_restJson1DescribeCACertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12374,7 +12374,7 @@ const deserializeAws_restJson1DescribeCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12445,7 +12445,7 @@ const deserializeAws_restJson1DescribeCustomMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12495,7 +12495,7 @@ const deserializeAws_restJson1DescribeDefaultAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12551,7 +12551,7 @@ const deserializeAws_restJson1DescribeDetectMitigationActionsTaskCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12616,7 +12616,7 @@ const deserializeAws_restJson1DescribeDimensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12690,7 +12690,7 @@ const deserializeAws_restJson1DescribeDomainConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12746,7 +12746,7 @@ const deserializeAws_restJson1DescribeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12802,7 +12802,7 @@ const deserializeAws_restJson1DescribeEventConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12882,7 +12882,7 @@ const deserializeAws_restJson1DescribeFleetMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12944,7 +12944,7 @@ const deserializeAws_restJson1DescribeIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13003,7 +13003,7 @@ const deserializeAws_restJson1DescribeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13053,7 +13053,7 @@ const deserializeAws_restJson1DescribeJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13139,7 +13139,7 @@ const deserializeAws_restJson1DescribeJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13207,7 +13207,7 @@ const deserializeAws_restJson1DescribeManagedJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13278,7 +13278,7 @@ const deserializeAws_restJson1DescribeMitigationActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13358,7 +13358,7 @@ const deserializeAws_restJson1DescribeProvisioningTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13420,7 +13420,7 @@ const deserializeAws_restJson1DescribeProvisioningTemplateVersionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13473,7 +13473,7 @@ const deserializeAws_restJson1DescribeRoleAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13544,7 +13544,7 @@ const deserializeAws_restJson1DescribeScheduledAuditCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13627,7 +13627,7 @@ const deserializeAws_restJson1DescribeSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13677,7 +13677,7 @@ const deserializeAws_restJson1DescribeStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13754,7 +13754,7 @@ const deserializeAws_restJson1DescribeThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13837,7 +13837,7 @@ const deserializeAws_restJson1DescribeThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13920,7 +13920,7 @@ const deserializeAws_restJson1DescribeThingRegistrationTaskCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13985,7 +13985,7 @@ const deserializeAws_restJson1DescribeThingTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14038,7 +14038,7 @@ const deserializeAws_restJson1DetachPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14091,7 +14091,7 @@ const deserializeAws_restJson1DetachPrincipalPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14144,7 +14144,7 @@ const deserializeAws_restJson1DetachSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14191,7 +14191,7 @@ const deserializeAws_restJson1DetachThingPrincipalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14244,7 +14244,7 @@ const deserializeAws_restJson1DisableTopicRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14294,7 +14294,7 @@ const deserializeAws_restJson1EnableTopicRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14350,7 +14350,7 @@ const deserializeAws_restJson1GetBehaviorModelTrainingSummariesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14403,7 +14403,7 @@ const deserializeAws_restJson1GetBucketsAggregationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14468,7 +14468,7 @@ const deserializeAws_restJson1GetCardinalityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14533,7 +14533,7 @@ const deserializeAws_restJson1GetEffectivePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14601,7 +14601,7 @@ const deserializeAws_restJson1GetIndexingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14654,7 +14654,7 @@ const deserializeAws_restJson1GetJobDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14707,7 +14707,7 @@ const deserializeAws_restJson1GetLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14754,7 +14754,7 @@ const deserializeAws_restJson1GetOTAUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14810,7 +14810,7 @@ const deserializeAws_restJson1GetPercentilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14893,7 +14893,7 @@ const deserializeAws_restJson1GetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14970,7 +14970,7 @@ const deserializeAws_restJson1GetPolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15026,7 +15026,7 @@ const deserializeAws_restJson1GetRegistrationCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15079,7 +15079,7 @@ const deserializeAws_restJson1GetStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15147,7 +15147,7 @@ const deserializeAws_restJson1GetTopicRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15197,7 +15197,7 @@ const deserializeAws_restJson1GetTopicRuleDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15253,7 +15253,7 @@ const deserializeAws_restJson1GetV2LoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15303,7 +15303,7 @@ const deserializeAws_restJson1ListActiveViolationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15356,7 +15356,7 @@ const deserializeAws_restJson1ListAttachedPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15418,7 +15418,7 @@ const deserializeAws_restJson1ListAuditFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15471,7 +15471,7 @@ const deserializeAws_restJson1ListAuditMitigationActionsExecutionsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15521,7 +15521,7 @@ const deserializeAws_restJson1ListAuditMitigationActionsTasksCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15571,7 +15571,7 @@ const deserializeAws_restJson1ListAuditSuppressionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15621,7 +15621,7 @@ const deserializeAws_restJson1ListAuditTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15671,7 +15671,7 @@ const deserializeAws_restJson1ListAuthorizersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15727,7 +15727,7 @@ const deserializeAws_restJson1ListBillingGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15780,7 +15780,7 @@ const deserializeAws_restJson1ListCACertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15836,7 +15836,7 @@ const deserializeAws_restJson1ListCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15892,7 +15892,7 @@ const deserializeAws_restJson1ListCertificatesByCACommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15948,7 +15948,7 @@ const deserializeAws_restJson1ListCustomMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16001,7 +16001,7 @@ const deserializeAws_restJson1ListDetectMitigationActionsExecutionsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16051,7 +16051,7 @@ const deserializeAws_restJson1ListDetectMitigationActionsTasksCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16101,7 +16101,7 @@ const deserializeAws_restJson1ListDimensionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16151,7 +16151,7 @@ const deserializeAws_restJson1ListDomainConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16207,7 +16207,7 @@ const deserializeAws_restJson1ListFleetMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16263,7 +16263,7 @@ const deserializeAws_restJson1ListIndicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16322,7 +16322,7 @@ const deserializeAws_restJson1ListJobExecutionsForJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16378,7 +16378,7 @@ const deserializeAws_restJson1ListJobExecutionsForThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16431,7 +16431,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16484,7 +16484,7 @@ const deserializeAws_restJson1ListJobTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16537,7 +16537,7 @@ const deserializeAws_restJson1ListManagedJobTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16590,7 +16590,7 @@ const deserializeAws_restJson1ListMetricValuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16646,7 +16646,7 @@ const deserializeAws_restJson1ListMitigationActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16696,7 +16696,7 @@ const deserializeAws_restJson1ListOTAUpdatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16752,7 +16752,7 @@ const deserializeAws_restJson1ListOutgoingCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16808,7 +16808,7 @@ const deserializeAws_restJson1ListPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16864,7 +16864,7 @@ const deserializeAws_restJson1ListPolicyPrincipalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16920,7 +16920,7 @@ const deserializeAws_restJson1ListPolicyVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16979,7 +16979,7 @@ const deserializeAws_restJson1ListPrincipalPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17038,7 +17038,7 @@ const deserializeAws_restJson1ListPrincipalThingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17097,7 +17097,7 @@ const deserializeAws_restJson1ListProvisioningTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17150,7 +17150,7 @@ const deserializeAws_restJson1ListProvisioningTemplateVersionsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17206,7 +17206,7 @@ const deserializeAws_restJson1ListRoleAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17262,7 +17262,7 @@ const deserializeAws_restJson1ListScheduledAuditsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17315,7 +17315,7 @@ const deserializeAws_restJson1ListSecurityProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17371,7 +17371,7 @@ const deserializeAws_restJson1ListSecurityProfilesForTargetCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17424,7 +17424,7 @@ const deserializeAws_restJson1ListStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17480,7 +17480,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17533,7 +17533,7 @@ const deserializeAws_restJson1ListTargetsForPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17598,7 +17598,7 @@ const deserializeAws_restJson1ListTargetsForSecurityProfileCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17651,7 +17651,7 @@ const deserializeAws_restJson1ListThingGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17704,7 +17704,7 @@ const deserializeAws_restJson1ListThingGroupsForThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17757,7 +17757,7 @@ const deserializeAws_restJson1ListThingPrincipalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17819,7 +17819,7 @@ const deserializeAws_restJson1ListThingRegistrationTaskReportsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17872,7 +17872,7 @@ const deserializeAws_restJson1ListThingRegistrationTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17925,7 +17925,7 @@ const deserializeAws_restJson1ListThingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17981,7 +17981,7 @@ const deserializeAws_restJson1ListThingsInBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18034,7 +18034,7 @@ const deserializeAws_restJson1ListThingsInThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18087,7 +18087,7 @@ const deserializeAws_restJson1ListThingTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18146,7 +18146,7 @@ const deserializeAws_restJson1ListTopicRuleDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18199,7 +18199,7 @@ const deserializeAws_restJson1ListTopicRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18252,7 +18252,7 @@ const deserializeAws_restJson1ListV2LoggingLevelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18305,7 +18305,7 @@ const deserializeAws_restJson1ListViolationEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18349,7 +18349,7 @@ const deserializeAws_restJson1PutVerificationStateOnViolationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18399,7 +18399,7 @@ const deserializeAws_restJson1RegisterCACertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18470,7 +18470,7 @@ const deserializeAws_restJson1RegisterCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18538,7 +18538,7 @@ const deserializeAws_restJson1RegisterCertificateWithoutCACommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18603,7 +18603,7 @@ const deserializeAws_restJson1RegisterThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18659,7 +18659,7 @@ const deserializeAws_restJson1RejectCertificateTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18715,7 +18715,7 @@ const deserializeAws_restJson1RemoveThingFromBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18762,7 +18762,7 @@ const deserializeAws_restJson1RemoveThingFromThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18809,7 +18809,7 @@ const deserializeAws_restJson1ReplaceTopicRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18871,7 +18871,7 @@ const deserializeAws_restJson1SearchIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18936,7 +18936,7 @@ const deserializeAws_restJson1SetDefaultAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -18992,7 +18992,7 @@ const deserializeAws_restJson1SetDefaultPolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19045,7 +19045,7 @@ const deserializeAws_restJson1SetLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19089,7 +19089,7 @@ const deserializeAws_restJson1SetV2LoggingLevelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19139,7 +19139,7 @@ const deserializeAws_restJson1SetV2LoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19186,7 +19186,7 @@ const deserializeAws_restJson1StartAuditMitigationActionsTaskCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19239,7 +19239,7 @@ const deserializeAws_restJson1StartDetectMitigationActionsTaskCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19292,7 +19292,7 @@ const deserializeAws_restJson1StartOnDemandAuditTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19342,7 +19342,7 @@ const deserializeAws_restJson1StartThingRegistrationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19389,7 +19389,7 @@ const deserializeAws_restJson1StopThingRegistrationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19439,7 +19439,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19492,7 +19492,7 @@ const deserializeAws_restJson1TestAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19563,7 +19563,7 @@ const deserializeAws_restJson1TestInvokeAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19622,7 +19622,7 @@ const deserializeAws_restJson1TransferCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19681,7 +19681,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19728,7 +19728,7 @@ const deserializeAws_restJson1UpdateAccountAuditConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19772,7 +19772,7 @@ const deserializeAws_restJson1UpdateAuditSuppressionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19825,7 +19825,7 @@ const deserializeAws_restJson1UpdateAuthorizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19884,7 +19884,7 @@ const deserializeAws_restJson1UpdateBillingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19934,7 +19934,7 @@ const deserializeAws_restJson1UpdateCACertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19987,7 +19987,7 @@ const deserializeAws_restJson1UpdateCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20061,7 +20061,7 @@ const deserializeAws_restJson1UpdateCustomMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20126,7 +20126,7 @@ const deserializeAws_restJson1UpdateDimensionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20179,7 +20179,7 @@ const deserializeAws_restJson1UpdateDomainConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20238,7 +20238,7 @@ const deserializeAws_restJson1UpdateDynamicThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20291,7 +20291,7 @@ const deserializeAws_restJson1UpdateEventConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20335,7 +20335,7 @@ const deserializeAws_restJson1UpdateFleetMetricCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20400,7 +20400,7 @@ const deserializeAws_restJson1UpdateIndexingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20450,7 +20450,7 @@ const deserializeAws_restJson1UpdateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20503,7 +20503,7 @@ const deserializeAws_restJson1UpdateMitigationActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20550,7 +20550,7 @@ const deserializeAws_restJson1UpdateProvisioningTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20606,7 +20606,7 @@ const deserializeAws_restJson1UpdateRoleAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20662,7 +20662,7 @@ const deserializeAws_restJson1UpdateScheduledAuditCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20745,7 +20745,7 @@ const deserializeAws_restJson1UpdateSecurityProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20807,7 +20807,7 @@ const deserializeAws_restJson1UpdateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20860,7 +20860,7 @@ const deserializeAws_restJson1UpdateThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20919,7 +20919,7 @@ const deserializeAws_restJson1UpdateThingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20969,7 +20969,7 @@ const deserializeAws_restJson1UpdateThingGroupsForThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -21016,7 +21016,7 @@ const deserializeAws_restJson1UpdateTopicRuleDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -21072,7 +21072,7 @@ const deserializeAws_restJson1ValidateSecurityProfileBehaviorsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -26973,6 +26973,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts index 91b802973002..a39bcb0badb4 100644 --- a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts @@ -1162,7 +1162,7 @@ const deserializeAws_restJson1BatchPutMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1212,7 +1212,7 @@ const deserializeAws_restJson1CancelPipelineReprocessingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1271,7 +1271,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1333,7 +1333,7 @@ const deserializeAws_restJson1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1389,7 +1389,7 @@ const deserializeAws_restJson1CreateDatasetContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1448,7 +1448,7 @@ const deserializeAws_restJson1CreateDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1507,7 +1507,7 @@ const deserializeAws_restJson1CreatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1560,7 +1560,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1610,7 +1610,7 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1660,7 +1660,7 @@ const deserializeAws_restJson1DeleteDatasetContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1710,7 +1710,7 @@ const deserializeAws_restJson1DeleteDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1760,7 +1760,7 @@ const deserializeAws_restJson1DeletePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1816,7 +1816,7 @@ const deserializeAws_restJson1DescribeChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1869,7 +1869,7 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1925,7 +1925,7 @@ const deserializeAws_restJson1DescribeDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1978,7 +1978,7 @@ const deserializeAws_restJson1DescribeLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2031,7 +2031,7 @@ const deserializeAws_restJson1DescribePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2090,7 +2090,7 @@ const deserializeAws_restJson1GetDatasetContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2146,7 +2146,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2202,7 +2202,7 @@ const deserializeAws_restJson1ListDatasetContentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2258,7 +2258,7 @@ const deserializeAws_restJson1ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2311,7 +2311,7 @@ const deserializeAws_restJson1ListDatastoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2364,7 +2364,7 @@ const deserializeAws_restJson1ListPipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2414,7 +2414,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2467,7 +2467,7 @@ const deserializeAws_restJson1PutLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2520,7 +2520,7 @@ const deserializeAws_restJson1RunPipelineActivityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2570,7 +2570,7 @@ const deserializeAws_restJson1SampleChannelDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2623,7 +2623,7 @@ const deserializeAws_restJson1StartPipelineReprocessingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2676,7 +2676,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2729,7 +2729,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2782,7 +2782,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2832,7 +2832,7 @@ const deserializeAws_restJson1UpdateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2882,7 +2882,7 @@ const deserializeAws_restJson1UpdateDatastoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2932,7 +2932,7 @@ const deserializeAws_restJson1UpdatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4954,6 +4954,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts index 0b9244a3ccf4..e79168c0fed5 100644 --- a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts @@ -497,7 +497,7 @@ const deserializeAws_restJson1CreateSuiteDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -538,7 +538,7 @@ const deserializeAws_restJson1DeleteSuiteDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -582,7 +582,7 @@ const deserializeAws_restJson1GetEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -653,7 +653,7 @@ const deserializeAws_restJson1GetSuiteDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -730,7 +730,7 @@ const deserializeAws_restJson1GetSuiteRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -777,7 +777,7 @@ const deserializeAws_restJson1GetSuiteRunReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -830,7 +830,7 @@ const deserializeAws_restJson1ListSuiteDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -877,7 +877,7 @@ const deserializeAws_restJson1ListSuiteRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -921,7 +921,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -974,7 +974,7 @@ const deserializeAws_restJson1StartSuiteRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1018,7 +1018,7 @@ const deserializeAws_restJson1StopSuiteRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1062,7 +1062,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1106,7 +1106,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1168,7 +1168,7 @@ const deserializeAws_restJson1UpdateSuiteDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1563,6 +1563,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts index 4a832ddcfa90..c6e149273696 100644 --- a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts @@ -284,7 +284,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -331,7 +331,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -414,7 +414,7 @@ const deserializeAws_restJson1DescribeApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -467,7 +467,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -514,7 +514,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -558,7 +558,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -602,7 +602,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -646,7 +646,7 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -855,6 +855,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts index e2d4fb6e0d16..2714ac6e07eb 100644 --- a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts +++ b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts @@ -966,7 +966,7 @@ const deserializeAws_json1_0AssociateVehicleFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1019,7 +1019,7 @@ const deserializeAws_json1_0BatchCreateVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1072,7 +1072,7 @@ const deserializeAws_json1_0BatchUpdateVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1122,7 +1122,7 @@ const deserializeAws_json1_0CreateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1181,7 +1181,7 @@ const deserializeAws_json1_0CreateDecoderManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1243,7 +1243,7 @@ const deserializeAws_json1_0CreateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1302,7 +1302,7 @@ const deserializeAws_json1_0CreateModelManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1364,7 +1364,7 @@ const deserializeAws_json1_0CreateSignalCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1426,7 +1426,7 @@ const deserializeAws_json1_0CreateVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1485,7 +1485,7 @@ const deserializeAws_json1_0DeleteCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_json1_0DeleteDecoderManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1591,7 +1591,7 @@ const deserializeAws_json1_0DeleteFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1641,7 +1641,7 @@ const deserializeAws_json1_0DeleteModelManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1694,7 +1694,7 @@ const deserializeAws_json1_0DeleteSignalCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1747,7 +1747,7 @@ const deserializeAws_json1_0DeleteVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1797,7 +1797,7 @@ const deserializeAws_json1_0DisassociateVehicleFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1850,7 +1850,7 @@ const deserializeAws_json1_0GetCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1903,7 +1903,7 @@ const deserializeAws_json1_0GetDecoderManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1956,7 +1956,7 @@ const deserializeAws_json1_0GetFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2009,7 +2009,7 @@ const deserializeAws_json1_0GetLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2056,7 +2056,7 @@ const deserializeAws_json1_0GetModelManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2106,7 +2106,7 @@ const deserializeAws_json1_0GetRegisterAccountStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2159,7 +2159,7 @@ const deserializeAws_json1_0GetSignalCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2212,7 +2212,7 @@ const deserializeAws_json1_0GetVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2265,7 +2265,7 @@ const deserializeAws_json1_0GetVehicleStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2318,7 +2318,7 @@ const deserializeAws_json1_0ImportDecoderManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2380,7 +2380,7 @@ const deserializeAws_json1_0ImportSignalCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2442,7 +2442,7 @@ const deserializeAws_json1_0ListCampaignsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2492,7 +2492,7 @@ const deserializeAws_json1_0ListDecoderManifestNetworkInterfacesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2545,7 +2545,7 @@ const deserializeAws_json1_0ListDecoderManifestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2595,7 +2595,7 @@ const deserializeAws_json1_0ListDecoderManifestSignalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2648,7 +2648,7 @@ const deserializeAws_json1_0ListFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2701,7 +2701,7 @@ const deserializeAws_json1_0ListFleetsForVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2754,7 +2754,7 @@ const deserializeAws_json1_0ListModelManifestNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2810,7 +2810,7 @@ const deserializeAws_json1_0ListModelManifestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2860,7 +2860,7 @@ const deserializeAws_json1_0ListSignalCatalogNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2916,7 +2916,7 @@ const deserializeAws_json1_0ListSignalCatalogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2966,7 +2966,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3019,7 +3019,7 @@ const deserializeAws_json1_0ListVehiclesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3069,7 +3069,7 @@ const deserializeAws_json1_0ListVehiclesInFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3122,7 +3122,7 @@ const deserializeAws_json1_0PutLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3178,7 +3178,7 @@ const deserializeAws_json1_0RegisterAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3234,7 +3234,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3287,7 +3287,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3340,7 +3340,7 @@ const deserializeAws_json1_0UpdateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3396,7 +3396,7 @@ const deserializeAws_json1_0UpdateDecoderManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3458,7 +3458,7 @@ const deserializeAws_json1_0UpdateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3514,7 +3514,7 @@ const deserializeAws_json1_0UpdateModelManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3573,7 +3573,7 @@ const deserializeAws_json1_0UpdateSignalCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3635,7 +3635,7 @@ const deserializeAws_json1_0UpdateVehicleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6173,6 +6173,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts index b2f9dbb85bae..a1aec9863429 100644 --- a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts @@ -185,7 +185,7 @@ const deserializeAws_json1_1CloseTunnelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -226,7 +226,7 @@ const deserializeAws_json1_1DescribeTunnelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -267,7 +267,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -308,7 +308,7 @@ const deserializeAws_json1_1ListTunnelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -343,7 +343,7 @@ const deserializeAws_json1_1OpenTunnelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -384,7 +384,7 @@ const deserializeAws_json1_1RotateTunnelAccessTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -425,7 +425,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -466,7 +466,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -859,6 +859,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts index a912f5d2b901..b7d0a65e1fa6 100644 --- a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts @@ -2774,7 +2774,7 @@ const deserializeAws_restJson1AssociateAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2830,7 +2830,7 @@ const deserializeAws_restJson1AssociateTimeSeriesToAssetPropertyCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2883,7 +2883,7 @@ const deserializeAws_restJson1BatchAssociateProjectAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2936,7 +2936,7 @@ const deserializeAws_restJson1BatchDisassociateProjectAssetsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3004,7 +3004,7 @@ const deserializeAws_restJson1BatchGetAssetPropertyAggregatesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3069,7 +3069,7 @@ const deserializeAws_restJson1BatchGetAssetPropertyValueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3137,7 +3137,7 @@ const deserializeAws_restJson1BatchGetAssetPropertyValueHistoryCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3187,7 +3187,7 @@ const deserializeAws_restJson1BatchPutAssetPropertyValueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3249,7 +3249,7 @@ const deserializeAws_restJson1CreateAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3308,7 +3308,7 @@ const deserializeAws_restJson1CreateAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3373,7 +3373,7 @@ const deserializeAws_restJson1CreateAssetModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3438,7 +3438,7 @@ const deserializeAws_restJson1CreateBulkImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3500,7 +3500,7 @@ const deserializeAws_restJson1CreateDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3556,7 +3556,7 @@ const deserializeAws_restJson1CreateGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3621,7 +3621,7 @@ const deserializeAws_restJson1CreatePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3677,7 +3677,7 @@ const deserializeAws_restJson1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3727,7 +3727,7 @@ const deserializeAws_restJson1DeleteAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3777,7 +3777,7 @@ const deserializeAws_restJson1DeleteAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3830,7 +3830,7 @@ const deserializeAws_restJson1DeleteAssetModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3880,7 +3880,7 @@ const deserializeAws_restJson1DeleteDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3927,7 +3927,7 @@ const deserializeAws_restJson1DeleteGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3977,7 +3977,7 @@ const deserializeAws_restJson1DeletePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4027,7 +4027,7 @@ const deserializeAws_restJson1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4074,7 +4074,7 @@ const deserializeAws_restJson1DeleteTimeSeriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4149,7 +4149,7 @@ const deserializeAws_restJson1DescribeAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4229,7 +4229,7 @@ const deserializeAws_restJson1DescribeAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4313,7 +4313,7 @@ const deserializeAws_restJson1DescribeAssetModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4375,7 +4375,7 @@ const deserializeAws_restJson1DescribeAssetPropertyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4449,7 +4449,7 @@ const deserializeAws_restJson1DescribeBulkImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4522,7 +4522,7 @@ const deserializeAws_restJson1DescribeDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4578,7 +4578,7 @@ const deserializeAws_restJson1DescribeDefaultEncryptionConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4646,7 +4646,7 @@ const deserializeAws_restJson1DescribeGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4705,7 +4705,7 @@ const deserializeAws_restJson1DescribeGatewayCapabilityConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4755,7 +4755,7 @@ const deserializeAws_restJson1DescribeLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4847,7 +4847,7 @@ const deserializeAws_restJson1DescribePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4915,7 +4915,7 @@ const deserializeAws_restJson1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4980,7 +4980,7 @@ const deserializeAws_restJson1DescribeStorageConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5061,7 +5061,7 @@ const deserializeAws_restJson1DescribeTimeSeriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5108,7 +5108,7 @@ const deserializeAws_restJson1DisassociateAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5158,7 +5158,7 @@ const deserializeAws_restJson1DisassociateTimeSeriesFromAssetPropertyCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5214,7 +5214,7 @@ const deserializeAws_restJson1GetAssetPropertyAggregatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5267,7 +5267,7 @@ const deserializeAws_restJson1GetAssetPropertyValueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5326,7 +5326,7 @@ const deserializeAws_restJson1GetAssetPropertyValueHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5385,7 +5385,7 @@ const deserializeAws_restJson1GetInterpolatedAssetPropertyValuesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5441,7 +5441,7 @@ const deserializeAws_restJson1ListAccessPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5491,7 +5491,7 @@ const deserializeAws_restJson1ListAssetModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5544,7 +5544,7 @@ const deserializeAws_restJson1ListAssetRelationshipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5597,7 +5597,7 @@ const deserializeAws_restJson1ListAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5650,7 +5650,7 @@ const deserializeAws_restJson1ListAssociatedAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5703,7 +5703,7 @@ const deserializeAws_restJson1ListBulkImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5756,7 +5756,7 @@ const deserializeAws_restJson1ListDashboardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5806,7 +5806,7 @@ const deserializeAws_restJson1ListGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5856,7 +5856,7 @@ const deserializeAws_restJson1ListPortalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5906,7 +5906,7 @@ const deserializeAws_restJson1ListProjectAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5956,7 +5956,7 @@ const deserializeAws_restJson1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6003,7 +6003,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6065,7 +6065,7 @@ const deserializeAws_restJson1ListTimeSeriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6121,7 +6121,7 @@ const deserializeAws_restJson1PutDefaultEncryptionConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6171,7 +6171,7 @@ const deserializeAws_restJson1PutLoggingOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6236,7 +6236,7 @@ const deserializeAws_restJson1PutStorageConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6292,7 +6292,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6351,7 +6351,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6407,7 +6407,7 @@ const deserializeAws_restJson1UpdateAccessPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6457,7 +6457,7 @@ const deserializeAws_restJson1UpdateAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6513,7 +6513,7 @@ const deserializeAws_restJson1UpdateAssetModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6569,7 +6569,7 @@ const deserializeAws_restJson1UpdateAssetPropertyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6619,7 +6619,7 @@ const deserializeAws_restJson1UpdateDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6666,7 +6666,7 @@ const deserializeAws_restJson1UpdateGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6722,7 +6722,7 @@ const deserializeAws_restJson1UpdateGatewayCapabilityConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6778,7 +6778,7 @@ const deserializeAws_restJson1UpdatePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6828,7 +6828,7 @@ const deserializeAws_restJson1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9082,6 +9082,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts index 03193d6e316f..589c4110731b 100644 --- a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts @@ -693,7 +693,7 @@ const deserializeAws_json1_1AssociateEntityToThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -743,7 +743,7 @@ const deserializeAws_json1_1CreateFlowTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -796,7 +796,7 @@ const deserializeAws_json1_1CreateSystemInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -849,7 +849,7 @@ const deserializeAws_json1_1CreateSystemTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -899,7 +899,7 @@ const deserializeAws_json1_1DeleteFlowTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -949,7 +949,7 @@ const deserializeAws_json1_1DeleteNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -993,7 +993,7 @@ const deserializeAws_json1_1DeleteSystemInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1043,7 +1043,7 @@ const deserializeAws_json1_1DeleteSystemTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1093,7 +1093,7 @@ const deserializeAws_json1_1DeploySystemInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1146,7 +1146,7 @@ const deserializeAws_json1_1DeprecateFlowTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1196,7 +1196,7 @@ const deserializeAws_json1_1DeprecateSystemTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1246,7 +1246,7 @@ const deserializeAws_json1_1DescribeNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1296,7 +1296,7 @@ const deserializeAws_json1_1DissociateEntityFromThingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1346,7 +1346,7 @@ const deserializeAws_json1_1GetEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1396,7 +1396,7 @@ const deserializeAws_json1_1GetFlowTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1446,7 +1446,7 @@ const deserializeAws_json1_1GetFlowTemplateRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1496,7 +1496,7 @@ const deserializeAws_json1_1GetNamespaceDeletionStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1543,7 +1543,7 @@ const deserializeAws_json1_1GetSystemInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1593,7 +1593,7 @@ const deserializeAws_json1_1GetSystemTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1643,7 +1643,7 @@ const deserializeAws_json1_1GetSystemTemplateRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1693,7 +1693,7 @@ const deserializeAws_json1_1GetUploadStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1743,7 +1743,7 @@ const deserializeAws_json1_1ListFlowExecutionMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1843,7 +1843,7 @@ const deserializeAws_json1_1SearchEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1890,7 +1890,7 @@ const deserializeAws_json1_1SearchFlowExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_json1_1SearchFlowTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1SearchSystemInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2034,7 +2034,7 @@ const deserializeAws_json1_1SearchSystemTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2081,7 +2081,7 @@ const deserializeAws_json1_1SearchThingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2131,7 +2131,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2181,7 +2181,7 @@ const deserializeAws_json1_1UndeploySystemInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2234,7 +2234,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2284,7 +2284,7 @@ const deserializeAws_json1_1UpdateFlowTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2334,7 +2334,7 @@ const deserializeAws_json1_1UpdateSystemTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,7 +2384,7 @@ const deserializeAws_json1_1UploadEntityDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3695,6 +3695,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts index ceae22967ddf..e95a4f683d77 100644 --- a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts @@ -1080,7 +1080,7 @@ const deserializeAws_restJson1BatchPutPropertyValuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1136,7 +1136,7 @@ const deserializeAws_restJson1CreateComponentTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1201,7 +1201,7 @@ const deserializeAws_restJson1CreateEntityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1260,7 +1260,7 @@ const deserializeAws_restJson1CreateSceneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1319,7 +1319,7 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1375,7 +1375,7 @@ const deserializeAws_restJson1DeleteComponentTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1428,7 +1428,7 @@ const deserializeAws_restJson1DeleteEntityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_restJson1DeleteSceneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1620,7 +1620,7 @@ const deserializeAws_restJson1GetComponentTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1700,7 +1700,7 @@ const deserializeAws_restJson1GetEntityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1753,7 +1753,7 @@ const deserializeAws_restJson1GetPropertyValueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1815,7 +1815,7 @@ const deserializeAws_restJson1GetPropertyValueHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1895,7 +1895,7 @@ const deserializeAws_restJson1GetSceneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1966,7 +1966,7 @@ const deserializeAws_restJson1GetWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2031,7 +2031,7 @@ const deserializeAws_restJson1ListComponentTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2084,7 +2084,7 @@ const deserializeAws_restJson1ListEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2137,7 +2137,7 @@ const deserializeAws_restJson1ListScenesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2190,7 +2190,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2237,7 +2237,7 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2284,7 +2284,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2328,7 +2328,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2381,7 +2381,7 @@ const deserializeAws_restJson1UpdateComponentTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2440,7 +2440,7 @@ const deserializeAws_restJson1UpdateEntityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2499,7 +2499,7 @@ const deserializeAws_restJson1UpdateSceneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2552,7 +2552,7 @@ const deserializeAws_restJson1UpdateWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3738,6 +3738,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ivs/src/protocols/Aws_restJson1.ts b/clients/client-ivs/src/protocols/Aws_restJson1.ts index f7d5f8419413..2d385167ae98 100644 --- a/clients/client-ivs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs/src/protocols/Aws_restJson1.ts @@ -844,7 +844,7 @@ const deserializeAws_restJson1BatchGetChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -882,7 +882,7 @@ const deserializeAws_restJson1BatchGetStreamKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -920,7 +920,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -976,7 +976,7 @@ const deserializeAws_restJson1CreateRecordingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1032,7 +1032,7 @@ const deserializeAws_restJson1CreateStreamKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1082,7 +1082,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1132,7 +1132,7 @@ const deserializeAws_restJson1DeletePlaybackKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1179,7 +1179,7 @@ const deserializeAws_restJson1DeleteRecordingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1229,7 +1229,7 @@ const deserializeAws_restJson1DeleteStreamKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1279,7 +1279,7 @@ const deserializeAws_restJson1GetChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1326,7 +1326,7 @@ const deserializeAws_restJson1GetPlaybackKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1376,7 +1376,7 @@ const deserializeAws_restJson1GetRecordingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1426,7 +1426,7 @@ const deserializeAws_restJson1GetStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1476,7 +1476,7 @@ const deserializeAws_restJson1GetStreamKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1523,7 +1523,7 @@ const deserializeAws_restJson1GetStreamSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1570,7 +1570,7 @@ const deserializeAws_restJson1ImportPlaybackKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1626,7 +1626,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1676,7 +1676,7 @@ const deserializeAws_restJson1ListPlaybackKeyPairsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1726,7 +1726,7 @@ const deserializeAws_restJson1ListRecordingConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1776,7 +1776,7 @@ const deserializeAws_restJson1ListStreamKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1826,7 +1826,7 @@ const deserializeAws_restJson1ListStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1873,7 +1873,7 @@ const deserializeAws_restJson1ListStreamSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1920,7 +1920,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1964,7 +1964,7 @@ const deserializeAws_restJson1PutMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2014,7 +2014,7 @@ const deserializeAws_restJson1StopStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2064,7 +2064,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2108,7 +2108,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2155,7 +2155,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2802,6 +2802,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ivschat/src/protocols/Aws_restJson1.ts b/clients/client-ivschat/src/protocols/Aws_restJson1.ts index 89b1da310cf6..4eb400ac6de6 100644 --- a/clients/client-ivschat/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivschat/src/protocols/Aws_restJson1.ts @@ -396,7 +396,7 @@ const deserializeAws_restJson1CreateChatTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -470,7 +470,7 @@ const deserializeAws_restJson1CreateRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -526,7 +526,7 @@ const deserializeAws_restJson1DeleteMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -573,7 +573,7 @@ const deserializeAws_restJson1DeleteRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -620,7 +620,7 @@ const deserializeAws_restJson1DisconnectUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -694,7 +694,7 @@ const deserializeAws_restJson1GetRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -744,7 +744,7 @@ const deserializeAws_restJson1ListRoomsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -791,7 +791,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -838,7 +838,7 @@ const deserializeAws_restJson1SendEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -885,7 +885,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -929,7 +929,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1000,7 +1000,7 @@ const deserializeAws_restJson1UpdateRoomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1351,6 +1351,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kafka/src/protocols/Aws_restJson1.ts b/clients/client-kafka/src/protocols/Aws_restJson1.ts index dc2aacc17870..6633000c7d70 100644 --- a/clients/client-kafka/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafka/src/protocols/Aws_restJson1.ts @@ -1122,7 +1122,7 @@ const deserializeAws_restJson1BatchAssociateScramSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1187,7 +1187,7 @@ const deserializeAws_restJson1BatchDisassociateScramSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1252,7 +1252,7 @@ const deserializeAws_restJson1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1320,7 +1320,7 @@ const deserializeAws_restJson1CreateClusterV2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1391,7 +1391,7 @@ const deserializeAws_restJson1CreateConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1453,7 +1453,7 @@ const deserializeAws_restJson1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1506,7 +1506,7 @@ const deserializeAws_restJson1DeleteConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1556,7 +1556,7 @@ const deserializeAws_restJson1DescribeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1609,7 +1609,7 @@ const deserializeAws_restJson1DescribeClusterOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1662,7 +1662,7 @@ const deserializeAws_restJson1DescribeClusterV2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1733,7 +1733,7 @@ const deserializeAws_restJson1DescribeConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1801,7 +1801,7 @@ const deserializeAws_restJson1DescribeConfigurationRevisionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1875,7 +1875,7 @@ const deserializeAws_restJson1GetBootstrapBrokersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1931,7 +1931,7 @@ const deserializeAws_restJson1GetCompatibleKafkaVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1996,7 +1996,7 @@ const deserializeAws_restJson1ListClusterOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2049,7 +2049,7 @@ const deserializeAws_restJson1ListClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2102,7 +2102,7 @@ const deserializeAws_restJson1ListClustersV2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2155,7 +2155,7 @@ const deserializeAws_restJson1ListConfigurationRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2214,7 +2214,7 @@ const deserializeAws_restJson1ListConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2270,7 +2270,7 @@ const deserializeAws_restJson1ListKafkaVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2323,7 +2323,7 @@ const deserializeAws_restJson1ListNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2376,7 +2376,7 @@ const deserializeAws_restJson1ListScramSecretsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2435,7 +2435,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2485,7 +2485,7 @@ const deserializeAws_restJson1RebootBrokerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2541,7 +2541,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2585,7 +2585,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2635,7 +2635,7 @@ const deserializeAws_restJson1UpdateBrokerCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2691,7 +2691,7 @@ const deserializeAws_restJson1UpdateBrokerStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2747,7 +2747,7 @@ const deserializeAws_restJson1UpdateBrokerTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2809,7 +2809,7 @@ const deserializeAws_restJson1UpdateClusterConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2868,7 +2868,7 @@ const deserializeAws_restJson1UpdateClusterKafkaVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2930,7 +2930,7 @@ const deserializeAws_restJson1UpdateConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2989,7 +2989,7 @@ const deserializeAws_restJson1UpdateConnectivityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3048,7 +3048,7 @@ const deserializeAws_restJson1UpdateMonitoringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3104,7 +3104,7 @@ const deserializeAws_restJson1UpdateSecurityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4388,6 +4388,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts index e46b05f6e0aa..9637d30ece91 100644 --- a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts @@ -499,7 +499,7 @@ const deserializeAws_restJson1CreateConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -570,7 +570,7 @@ const deserializeAws_restJson1CreateCustomPluginCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -641,7 +641,7 @@ const deserializeAws_restJson1CreateWorkerConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -706,7 +706,7 @@ const deserializeAws_restJson1DeleteConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -768,7 +768,7 @@ const deserializeAws_restJson1DeleteCustomPluginCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -887,7 +887,7 @@ const deserializeAws_restJson1DescribeConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -964,7 +964,7 @@ const deserializeAws_restJson1DescribeCustomPluginCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1038,7 +1038,7 @@ const deserializeAws_restJson1DescribeWorkerConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1100,7 +1100,7 @@ const deserializeAws_restJson1ListConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1162,7 +1162,7 @@ const deserializeAws_restJson1ListCustomPluginsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1227,7 +1227,7 @@ const deserializeAws_restJson1ListWorkerConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1289,7 +1289,7 @@ const deserializeAws_restJson1UpdateConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2169,6 +2169,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kendra/src/protocols/Aws_json1_1.ts b/clients/client-kendra/src/protocols/Aws_json1_1.ts index 25704fb1ffa5..900553b7dbfe 100644 --- a/clients/client-kendra/src/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/src/protocols/Aws_json1_1.ts @@ -1225,7 +1225,7 @@ const deserializeAws_json1_1AssociateEntitiesToExperienceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1281,7 +1281,7 @@ const deserializeAws_json1_1AssociatePersonasToEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1337,7 +1337,7 @@ const deserializeAws_json1_1BatchDeleteDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1393,7 +1393,7 @@ const deserializeAws_json1_1BatchGetDocumentStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1449,7 +1449,7 @@ const deserializeAws_json1_1BatchPutDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1505,7 +1505,7 @@ const deserializeAws_json1_1ClearQuerySuggestionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1561,7 +1561,7 @@ const deserializeAws_json1_1CreateAccessControlConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1620,7 +1620,7 @@ const deserializeAws_json1_1CreateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1682,7 +1682,7 @@ const deserializeAws_json1_1CreateExperienceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1741,7 +1741,7 @@ const deserializeAws_json1_1CreateFaqCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1800,7 +1800,7 @@ const deserializeAws_json1_1CreateIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1859,7 +1859,7 @@ const deserializeAws_json1_1CreateQuerySuggestionsBlockListCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1918,7 +1918,7 @@ const deserializeAws_json1_1CreateThesaurusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1977,7 +1977,7 @@ const deserializeAws_json1_1DeleteAccessControlConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_json1_1DeleteDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2086,7 +2086,7 @@ const deserializeAws_json1_1DeleteExperienceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2139,7 +2139,7 @@ const deserializeAws_json1_1DeleteFaqCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2192,7 +2192,7 @@ const deserializeAws_json1_1DeleteIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2245,7 +2245,7 @@ const deserializeAws_json1_1DeletePrincipalMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2298,7 +2298,7 @@ const deserializeAws_json1_1DeleteQuerySuggestionsBlockListCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2351,7 +2351,7 @@ const deserializeAws_json1_1DeleteThesaurusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2407,7 +2407,7 @@ const deserializeAws_json1_1DescribeAccessControlConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2460,7 +2460,7 @@ const deserializeAws_json1_1DescribeDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2513,7 +2513,7 @@ const deserializeAws_json1_1DescribeExperienceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2566,7 +2566,7 @@ const deserializeAws_json1_1DescribeFaqCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2619,7 +2619,7 @@ const deserializeAws_json1_1DescribeIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2672,7 +2672,7 @@ const deserializeAws_json1_1DescribePrincipalMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2725,7 +2725,7 @@ const deserializeAws_json1_1DescribeQuerySuggestionsBlockListCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2778,7 +2778,7 @@ const deserializeAws_json1_1DescribeQuerySuggestionsConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2831,7 +2831,7 @@ const deserializeAws_json1_1DescribeThesaurusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2884,7 +2884,7 @@ const deserializeAws_json1_1DisassociateEntitiesFromExperienceCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2937,7 +2937,7 @@ const deserializeAws_json1_1DisassociatePersonasFromEntitiesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2990,7 +2990,7 @@ const deserializeAws_json1_1GetQuerySuggestionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3049,7 +3049,7 @@ const deserializeAws_json1_1GetSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3099,7 +3099,7 @@ const deserializeAws_json1_1ListAccessControlConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3152,7 +3152,7 @@ const deserializeAws_json1_1ListDataSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3205,7 +3205,7 @@ const deserializeAws_json1_1ListDataSourceSyncJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3261,7 +3261,7 @@ const deserializeAws_json1_1ListEntityPersonasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3314,7 +3314,7 @@ const deserializeAws_json1_1ListExperienceEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3367,7 +3367,7 @@ const deserializeAws_json1_1ListExperiencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3420,7 +3420,7 @@ const deserializeAws_json1_1ListFaqsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3473,7 +3473,7 @@ const deserializeAws_json1_1ListGroupsOlderThanOrderingIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3529,7 +3529,7 @@ const deserializeAws_json1_1ListIndicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3579,7 +3579,7 @@ const deserializeAws_json1_1ListQuerySuggestionsBlockListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3632,7 +3632,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3685,7 +3685,7 @@ const deserializeAws_json1_1ListThesauriCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3735,7 +3735,7 @@ const deserializeAws_json1_1PutPrincipalMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3794,7 +3794,7 @@ const deserializeAws_json1_1QueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3853,7 +3853,7 @@ const deserializeAws_json1_1StartDataSourceSyncJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3909,7 +3909,7 @@ const deserializeAws_json1_1StopDataSourceSyncJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3959,7 +3959,7 @@ const deserializeAws_json1_1SubmitFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4015,7 +4015,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4068,7 +4068,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4121,7 +4121,7 @@ const deserializeAws_json1_1UpdateAccessControlConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4177,7 +4177,7 @@ const deserializeAws_json1_1UpdateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4230,7 +4230,7 @@ const deserializeAws_json1_1UpdateExperienceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4283,7 +4283,7 @@ const deserializeAws_json1_1UpdateIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4339,7 +4339,7 @@ const deserializeAws_json1_1UpdateQuerySuggestionsBlockListCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4392,7 +4392,7 @@ const deserializeAws_json1_1UpdateQuerySuggestionsConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4445,7 +4445,7 @@ const deserializeAws_json1_1UpdateThesaurusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11008,6 +11008,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts index c6ab84735af3..d213e47001dc 100644 --- a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts +++ b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts @@ -276,7 +276,7 @@ const deserializeAws_json1_0CreateKeyspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -329,7 +329,7 @@ const deserializeAws_json1_0CreateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -385,7 +385,7 @@ const deserializeAws_json1_0DeleteKeyspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -441,7 +441,7 @@ const deserializeAws_json1_0DeleteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -497,7 +497,7 @@ const deserializeAws_json1_0GetKeyspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -550,7 +550,7 @@ const deserializeAws_json1_0GetTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -603,7 +603,7 @@ const deserializeAws_json1_0ListKeyspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -656,7 +656,7 @@ const deserializeAws_json1_0ListTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -709,7 +709,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -762,7 +762,7 @@ const deserializeAws_json1_0RestoreTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -818,7 +818,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -871,7 +871,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -927,7 +927,7 @@ const deserializeAws_json1_0UpdateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1703,6 +1703,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts index 5f17ae8c9960..33a425e9cfdf 100644 --- a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts @@ -742,7 +742,7 @@ const deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -798,7 +798,7 @@ const deserializeAws_json1_1AddApplicationInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -854,7 +854,7 @@ const deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -907,7 +907,7 @@ const deserializeAws_json1_1AddApplicationOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -960,7 +960,7 @@ const deserializeAws_json1_1AddApplicationReferenceDataSourceCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1013,7 +1013,7 @@ const deserializeAws_json1_1AddApplicationVpcConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1066,7 +1066,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1128,7 +1128,7 @@ const deserializeAws_json1_1CreateApplicationPresignedUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1175,7 +1175,7 @@ const deserializeAws_json1_1CreateApplicationSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1234,7 +1234,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1290,7 +1290,7 @@ const deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1346,7 +1346,7 @@ const deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1399,7 +1399,7 @@ const deserializeAws_json1_1DeleteApplicationOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1452,7 +1452,7 @@ const deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1505,7 +1505,7 @@ const deserializeAws_json1_1DeleteApplicationSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1558,7 +1558,7 @@ const deserializeAws_json1_1DeleteApplicationVpcConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1611,7 +1611,7 @@ const deserializeAws_json1_1DescribeApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1658,7 +1658,7 @@ const deserializeAws_json1_1DescribeApplicationSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_json1_1DescribeApplicationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1752,7 +1752,7 @@ const deserializeAws_json1_1DiscoverInputSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1808,7 +1808,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1849,7 +1849,7 @@ const deserializeAws_json1_1ListApplicationSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1893,7 +1893,7 @@ const deserializeAws_json1_1ListApplicationVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1RollbackApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2043,7 +2043,7 @@ const deserializeAws_json1_1StartApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2096,7 +2096,7 @@ const deserializeAws_json1_1StopApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2152,7 +2152,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2205,7 +2205,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2258,7 +2258,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2320,7 +2320,7 @@ const deserializeAws_json1_1UpdateApplicationMaintenanceConfigurationCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5555,6 +5555,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts index 56b84f9d14cb..41b7c1bc7e7a 100644 --- a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts @@ -466,7 +466,7 @@ const deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -519,7 +519,7 @@ const deserializeAws_json1_1AddApplicationInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -575,7 +575,7 @@ const deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -628,7 +628,7 @@ const deserializeAws_json1_1AddApplicationOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -681,7 +681,7 @@ const deserializeAws_json1_1AddApplicationReferenceDataSourceCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -734,7 +734,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -790,7 +790,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -840,7 +840,7 @@ const deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -893,7 +893,7 @@ const deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -946,7 +946,7 @@ const deserializeAws_json1_1DeleteApplicationOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -999,7 +999,7 @@ const deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1052,7 +1052,7 @@ const deserializeAws_json1_1DescribeApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1096,7 +1096,7 @@ const deserializeAws_json1_1DiscoverInputSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1146,7 +1146,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1181,7 +1181,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1228,7 +1228,7 @@ const deserializeAws_json1_1StartApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1281,7 +1281,7 @@ const deserializeAws_json1_1StopApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1328,7 +1328,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1381,7 +1381,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1434,7 +1434,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3165,6 +3165,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts index e2ac461b1a03..2904a4482a26 100644 --- a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts @@ -271,7 +271,7 @@ const deserializeAws_restJson1GetClipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -336,7 +336,7 @@ const deserializeAws_restJson1GetDASHStreamingSessionURLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -398,7 +398,7 @@ const deserializeAws_restJson1GetHLSStreamingSessionURLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -463,7 +463,7 @@ const deserializeAws_restJson1GetImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -512,7 +512,7 @@ const deserializeAws_restJson1GetMediaForFragmentListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -565,7 +565,7 @@ const deserializeAws_restJson1ListFragmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -904,6 +904,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts index 2e8289453c15..301e0a2332fd 100644 --- a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts @@ -74,7 +74,7 @@ const deserializeAws_restJson1GetMediaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -247,6 +247,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts index 03972609b0f0..28220ae1caaa 100644 --- a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts @@ -109,7 +109,7 @@ const deserializeAws_restJson1GetIceServerConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -165,7 +165,7 @@ const deserializeAws_restJson1SendAlexaOfferToMasterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -356,6 +356,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts index ba201a45d980..1d3c3db10b1a 100644 --- a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts @@ -765,7 +765,7 @@ const deserializeAws_restJson1CreateSignalingChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -821,7 +821,7 @@ const deserializeAws_restJson1CreateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -877,7 +877,7 @@ const deserializeAws_restJson1DeleteSignalingChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -930,7 +930,7 @@ const deserializeAws_restJson1DeleteStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -989,7 +989,7 @@ const deserializeAws_restJson1DescribeImageGenerationConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1042,7 +1042,7 @@ const deserializeAws_restJson1DescribeNotificationConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1092,7 +1092,7 @@ const deserializeAws_restJson1DescribeSignalingChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1142,7 +1142,7 @@ const deserializeAws_restJson1DescribeStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1192,7 +1192,7 @@ const deserializeAws_restJson1GetDataEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1242,7 +1242,7 @@ const deserializeAws_restJson1GetSignalingChannelEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1298,7 +1298,7 @@ const deserializeAws_restJson1ListSignalingChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1348,7 +1348,7 @@ const deserializeAws_restJson1ListStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1395,7 +1395,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1448,7 +1448,7 @@ const deserializeAws_restJson1ListTagsForStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1498,7 +1498,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1548,7 +1548,7 @@ const deserializeAws_restJson1TagStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1601,7 +1601,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1648,7 +1648,7 @@ const deserializeAws_restJson1UntagStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1698,7 +1698,7 @@ const deserializeAws_restJson1UpdateDataRetentionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1751,7 +1751,7 @@ const deserializeAws_restJson1UpdateImageGenerationConfigurationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1804,7 +1804,7 @@ const deserializeAws_restJson1UpdateNotificationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1857,7 +1857,7 @@ const deserializeAws_restJson1UpdateSignalingChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1910,7 +1910,7 @@ const deserializeAws_restJson1UpdateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2518,6 +2518,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kinesis/src/protocols/Aws_json1_1.ts b/clients/client-kinesis/src/protocols/Aws_json1_1.ts index 7dc96c0b4b02..1d970bb0f518 100644 --- a/clients/client-kinesis/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/src/protocols/Aws_json1_1.ts @@ -563,7 +563,7 @@ const deserializeAws_json1_1AddTagsToStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -610,7 +610,7 @@ const deserializeAws_json1_1CreateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -654,7 +654,7 @@ const deserializeAws_json1_1DecreaseStreamRetentionPeriodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -701,7 +701,7 @@ const deserializeAws_json1_1DeleteStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -745,7 +745,7 @@ const deserializeAws_json1_1DeregisterStreamConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -792,7 +792,7 @@ const deserializeAws_json1_1DescribeLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -833,7 +833,7 @@ const deserializeAws_json1_1DescribeStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -877,7 +877,7 @@ const deserializeAws_json1_1DescribeStreamConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -924,7 +924,7 @@ const deserializeAws_json1_1DescribeStreamSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -968,7 +968,7 @@ const deserializeAws_json1_1DisableEnhancedMonitoringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1018,7 +1018,7 @@ const deserializeAws_json1_1EnableEnhancedMonitoringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1068,7 +1068,7 @@ const deserializeAws_json1_1GetRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1136,7 +1136,7 @@ const deserializeAws_json1_1GetShardIteratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1180,7 +1180,7 @@ const deserializeAws_json1_1IncreaseStreamRetentionPeriodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1230,7 +1230,7 @@ const deserializeAws_json1_1ListShardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1283,7 +1283,7 @@ const deserializeAws_json1_1ListStreamConsumersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1336,7 +1336,7 @@ const deserializeAws_json1_1ListStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1377,7 +1377,7 @@ const deserializeAws_json1_1ListTagsForStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1421,7 +1421,7 @@ const deserializeAws_json1_1MergeShardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1474,7 +1474,7 @@ const deserializeAws_json1_1PutRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1539,7 +1539,7 @@ const deserializeAws_json1_1PutRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1604,7 +1604,7 @@ const deserializeAws_json1_1RegisterStreamConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1651,7 +1651,7 @@ const deserializeAws_json1_1RemoveTagsFromStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1698,7 +1698,7 @@ const deserializeAws_json1_1SplitShardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1748,7 +1748,7 @@ const deserializeAws_json1_1StartStreamEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1813,7 +1813,7 @@ const deserializeAws_json1_1StopStreamEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1861,7 +1861,7 @@ const deserializeAws_json1_1SubscribeToShardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1911,7 +1911,7 @@ const deserializeAws_json1_1UpdateShardCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1961,7 +1961,7 @@ const deserializeAws_json1_1UpdateStreamModeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3311,6 +3311,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-kms/src/protocols/Aws_json1_1.ts b/clients/client-kms/src/protocols/Aws_json1_1.ts index a670fa5de0cc..f0852d3f0fd6 100644 --- a/clients/client-kms/src/protocols/Aws_json1_1.ts +++ b/clients/client-kms/src/protocols/Aws_json1_1.ts @@ -923,7 +923,7 @@ const deserializeAws_json1_1CancelKeyDeletionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -976,7 +976,7 @@ const deserializeAws_json1_1ConnectCustomKeyStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1026,7 +1026,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1085,7 +1085,7 @@ const deserializeAws_json1_1CreateCustomKeyStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1144,7 +1144,7 @@ const deserializeAws_json1_1CreateGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1206,7 +1206,7 @@ const deserializeAws_json1_1CreateKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1274,7 +1274,7 @@ const deserializeAws_json1_1DecryptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1339,7 +1339,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1389,7 +1389,7 @@ const deserializeAws_json1_1DeleteCustomKeyStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1436,7 +1436,7 @@ const deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1492,7 +1492,7 @@ const deserializeAws_json1_1DescribeCustomKeyStoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1539,7 +1539,7 @@ const deserializeAws_json1_1DescribeKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1586,7 +1586,7 @@ const deserializeAws_json1_1DisableKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1636,7 +1636,7 @@ const deserializeAws_json1_1DisableKeyRotationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1695,7 +1695,7 @@ const deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1739,7 +1739,7 @@ const deserializeAws_json1_1EnableKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1792,7 +1792,7 @@ const deserializeAws_json1_1EnableKeyRotationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1851,7 +1851,7 @@ const deserializeAws_json1_1EncryptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1913,7 +1913,7 @@ const deserializeAws_json1_1GenerateDataKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1975,7 +1975,7 @@ const deserializeAws_json1_1GenerateDataKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2040,7 +2040,7 @@ const deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2105,7 +2105,7 @@ const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2167,7 +2167,7 @@ const deserializeAws_json1_1GenerateMacCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2226,7 +2226,7 @@ const deserializeAws_json1_1GenerateRandomCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2276,7 +2276,7 @@ const deserializeAws_json1_1GetKeyPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2329,7 +2329,7 @@ const deserializeAws_json1_1GetKeyRotationStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2385,7 +2385,7 @@ const deserializeAws_json1_1GetParametersForImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2441,7 +2441,7 @@ const deserializeAws_json1_1GetPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2509,7 +2509,7 @@ const deserializeAws_json1_1ImportKeyMaterialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2577,7 +2577,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2630,7 +2630,7 @@ const deserializeAws_json1_1ListGrantsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2689,7 +2689,7 @@ const deserializeAws_json1_1ListKeyPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2742,7 +2742,7 @@ const deserializeAws_json1_1ListKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2789,7 +2789,7 @@ const deserializeAws_json1_1ListResourceTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2839,7 +2839,7 @@ const deserializeAws_json1_1ListRetirableGrantsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2889,7 +2889,7 @@ const deserializeAws_json1_1PutKeyPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2951,7 +2951,7 @@ const deserializeAws_json1_1ReEncryptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3019,7 +3019,7 @@ const deserializeAws_json1_1ReplicateKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3084,7 +3084,7 @@ const deserializeAws_json1_1RetireGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3140,7 +3140,7 @@ const deserializeAws_json1_1RevokeGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3196,7 +3196,7 @@ const deserializeAws_json1_1ScheduleKeyDeletionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3249,7 +3249,7 @@ const deserializeAws_json1_1SignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3308,7 +3308,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3361,7 +3361,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3411,7 +3411,7 @@ const deserializeAws_json1_1UpdateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3464,7 +3464,7 @@ const deserializeAws_json1_1UpdateCustomKeyStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3523,7 +3523,7 @@ const deserializeAws_json1_1UpdateKeyDescriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3573,7 +3573,7 @@ const deserializeAws_json1_1UpdatePrimaryRegionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3629,7 +3629,7 @@ const deserializeAws_json1_1VerifyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3694,7 +3694,7 @@ const deserializeAws_json1_1VerifyMacCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5692,6 +5692,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts index da03e0e07ad4..28053d1f7f91 100644 --- a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts +++ b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts @@ -1466,7 +1466,7 @@ const deserializeAws_restJson1AddLFTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_restJson1AssumeDecoratedRoleWithSAMLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1584,7 +1584,7 @@ const deserializeAws_restJson1BatchGrantPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1628,7 +1628,7 @@ const deserializeAws_restJson1BatchRevokePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1669,7 +1669,7 @@ const deserializeAws_restJson1CancelTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1728,7 +1728,7 @@ const deserializeAws_restJson1CommitTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1781,7 +1781,7 @@ const deserializeAws_restJson1CreateDataCellsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1837,7 +1837,7 @@ const deserializeAws_restJson1CreateLFTagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1890,7 +1890,7 @@ const deserializeAws_restJson1DeleteDataCellsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_restJson1DeleteLFTagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1990,7 +1990,7 @@ const deserializeAws_restJson1DeleteObjectsOnCancelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2049,7 +2049,7 @@ const deserializeAws_restJson1DeregisterResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2099,7 +2099,7 @@ const deserializeAws_restJson1DescribeResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2152,7 +2152,7 @@ const deserializeAws_restJson1DescribeTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2199,7 +2199,7 @@ const deserializeAws_restJson1ExtendTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2258,7 +2258,7 @@ const deserializeAws_restJson1GetDataLakeSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2308,7 +2308,7 @@ const deserializeAws_restJson1GetEffectivePermissionsForPathCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2364,7 +2364,7 @@ const deserializeAws_restJson1GetLFTagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2420,7 +2420,7 @@ const deserializeAws_restJson1GetQueryStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2473,7 +2473,7 @@ const deserializeAws_restJson1GetQueryStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2535,7 +2535,7 @@ const deserializeAws_restJson1GetResourceLFTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2594,7 +2594,7 @@ const deserializeAws_restJson1GetTableObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2662,7 +2662,7 @@ const deserializeAws_restJson1GetTemporaryGluePartitionCredentialsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2727,7 +2727,7 @@ const deserializeAws_restJson1GetTemporaryGlueTableCredentialsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2781,7 +2781,7 @@ const deserializeAws_restJson1GetWorkUnitResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2840,7 +2840,7 @@ const deserializeAws_restJson1GetWorkUnitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2890,7 +2890,7 @@ const deserializeAws_restJson1GrantPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2940,7 +2940,7 @@ const deserializeAws_restJson1ListDataCellsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2993,7 +2993,7 @@ const deserializeAws_restJson1ListLFTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3052,7 +3052,7 @@ const deserializeAws_restJson1ListPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3102,7 +3102,7 @@ const deserializeAws_restJson1ListResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3152,7 +3152,7 @@ const deserializeAws_restJson1ListTableStorageOptimizersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3205,7 +3205,7 @@ const deserializeAws_restJson1ListTransactionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3249,7 +3249,7 @@ const deserializeAws_restJson1PutDataLakeSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3290,7 +3290,7 @@ const deserializeAws_restJson1RegisterResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3349,7 +3349,7 @@ const deserializeAws_restJson1RemoveLFTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3405,7 +3405,7 @@ const deserializeAws_restJson1RevokePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3455,7 +3455,7 @@ const deserializeAws_restJson1SearchDatabasesByLFTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3514,7 +3514,7 @@ const deserializeAws_restJson1SearchTablesByLFTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3570,7 +3570,7 @@ const deserializeAws_restJson1StartQueryPlanningCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3620,7 +3620,7 @@ const deserializeAws_restJson1StartTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3661,7 +3661,7 @@ const deserializeAws_restJson1UpdateLFTagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3714,7 +3714,7 @@ const deserializeAws_restJson1UpdateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3761,7 +3761,7 @@ const deserializeAws_restJson1UpdateTableObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3826,7 +3826,7 @@ const deserializeAws_restJson1UpdateTableStorageOptimizerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5343,6 +5343,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lambda/src/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts index e801a90c05ec..5a24092a320e 100644 --- a/clients/client-lambda/src/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/src/protocols/Aws_restJson1.ts @@ -2463,7 +2463,7 @@ const deserializeAws_restJson1AddLayerVersionPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2522,7 +2522,7 @@ const deserializeAws_restJson1AddPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2596,7 +2596,7 @@ const deserializeAws_restJson1CreateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2649,7 +2649,7 @@ const deserializeAws_restJson1CreateCodeSigningConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2782,7 +2782,7 @@ const deserializeAws_restJson1CreateEventSourceMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2931,7 +2931,7 @@ const deserializeAws_restJson1CreateFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3008,7 +3008,7 @@ const deserializeAws_restJson1CreateFunctionUrlConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3058,7 +3058,7 @@ const deserializeAws_restJson1DeleteAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3105,7 +3105,7 @@ const deserializeAws_restJson1DeleteCodeSigningConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3244,7 +3244,7 @@ const deserializeAws_restJson1DeleteEventSourceMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3294,7 +3294,7 @@ const deserializeAws_restJson1DeleteFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3344,7 +3344,7 @@ const deserializeAws_restJson1DeleteFunctionCodeSigningConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3397,7 +3397,7 @@ const deserializeAws_restJson1DeleteFunctionConcurrencyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3447,7 +3447,7 @@ const deserializeAws_restJson1DeleteFunctionEventInvokeConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3497,7 +3497,7 @@ const deserializeAws_restJson1DeleteFunctionUrlConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3544,7 +3544,7 @@ const deserializeAws_restJson1DeleteLayerVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3585,7 +3585,7 @@ const deserializeAws_restJson1DeleteProvisionedConcurrencyConfigCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3641,7 +3641,7 @@ const deserializeAws_restJson1GetAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3700,7 +3700,7 @@ const deserializeAws_restJson1GetAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3750,7 +3750,7 @@ const deserializeAws_restJson1GetCodeSigningConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3886,7 +3886,7 @@ const deserializeAws_restJson1GetEventSourceMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3945,7 +3945,7 @@ const deserializeAws_restJson1GetFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3998,7 +3998,7 @@ const deserializeAws_restJson1GetFunctionCodeSigningConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4048,7 +4048,7 @@ const deserializeAws_restJson1GetFunctionConcurrencyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4194,7 +4194,7 @@ const deserializeAws_restJson1GetFunctionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4256,7 +4256,7 @@ const deserializeAws_restJson1GetFunctionEventInvokeConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4321,7 +4321,7 @@ const deserializeAws_restJson1GetFunctionUrlConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4398,7 +4398,7 @@ const deserializeAws_restJson1GetLayerVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4475,7 +4475,7 @@ const deserializeAws_restJson1GetLayerVersionByArnCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4528,7 +4528,7 @@ const deserializeAws_restJson1GetLayerVersionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4581,7 +4581,7 @@ const deserializeAws_restJson1GetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4646,7 +4646,7 @@ const deserializeAws_restJson1GetProvisionedConcurrencyConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4703,7 +4703,7 @@ const deserializeAws_restJson1InvokeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4819,7 +4819,7 @@ const deserializeAws_restJson1InvokeAsyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4875,7 +4875,7 @@ const deserializeAws_restJson1ListAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4928,7 +4928,7 @@ const deserializeAws_restJson1ListCodeSigningConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4975,7 +4975,7 @@ const deserializeAws_restJson1ListEventSourceMappingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5031,7 +5031,7 @@ const deserializeAws_restJson1ListFunctionEventInvokeConfigsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5084,7 +5084,7 @@ const deserializeAws_restJson1ListFunctionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5134,7 +5134,7 @@ const deserializeAws_restJson1ListFunctionsByCodeSigningConfigCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5184,7 +5184,7 @@ const deserializeAws_restJson1ListFunctionUrlConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5237,7 +5237,7 @@ const deserializeAws_restJson1ListLayersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5287,7 +5287,7 @@ const deserializeAws_restJson1ListLayerVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5343,7 +5343,7 @@ const deserializeAws_restJson1ListProvisionedConcurrencyConfigsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5393,7 +5393,7 @@ const deserializeAws_restJson1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5446,7 +5446,7 @@ const deserializeAws_restJson1ListVersionsByFunctionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5523,7 +5523,7 @@ const deserializeAws_restJson1PublishLayerVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5672,7 +5672,7 @@ const deserializeAws_restJson1PublishVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5734,7 +5734,7 @@ const deserializeAws_restJson1PutFunctionCodeSigningConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5790,7 +5790,7 @@ const deserializeAws_restJson1PutFunctionConcurrencyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5855,7 +5855,7 @@ const deserializeAws_restJson1PutFunctionEventInvokeConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5923,7 +5923,7 @@ const deserializeAws_restJson1PutProvisionedConcurrencyConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5973,7 +5973,7 @@ const deserializeAws_restJson1RemoveLayerVersionPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6023,7 +6023,7 @@ const deserializeAws_restJson1RemovePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6073,7 +6073,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6123,7 +6123,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6191,7 +6191,7 @@ const deserializeAws_restJson1UpdateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6247,7 +6247,7 @@ const deserializeAws_restJson1UpdateCodeSigningConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6383,7 +6383,7 @@ const deserializeAws_restJson1UpdateEventSourceMappingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6535,7 +6535,7 @@ const deserializeAws_restJson1UpdateFunctionCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6699,7 +6699,7 @@ const deserializeAws_restJson1UpdateFunctionConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6776,7 +6776,7 @@ const deserializeAws_restJson1UpdateFunctionEventInvokeConfigCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6844,7 +6844,7 @@ const deserializeAws_restJson1UpdateFunctionUrlConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8818,6 +8818,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts index 2cc54bccf4e6..dbf4f5e80b6c 100644 --- a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts @@ -1301,7 +1301,7 @@ const deserializeAws_restJson1CreateBotVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1408,7 +1408,7 @@ const deserializeAws_restJson1CreateIntentVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1494,7 +1494,7 @@ const deserializeAws_restJson1CreateSlotTypeVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1547,7 +1547,7 @@ const deserializeAws_restJson1DeleteBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1600,7 +1600,7 @@ const deserializeAws_restJson1DeleteBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1653,7 +1653,7 @@ const deserializeAws_restJson1DeleteBotChannelAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1703,7 +1703,7 @@ const deserializeAws_restJson1DeleteBotVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1756,7 +1756,7 @@ const deserializeAws_restJson1DeleteIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1809,7 +1809,7 @@ const deserializeAws_restJson1DeleteIntentVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1862,7 +1862,7 @@ const deserializeAws_restJson1DeleteSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1915,7 +1915,7 @@ const deserializeAws_restJson1DeleteSlotTypeVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1968,7 +1968,7 @@ const deserializeAws_restJson1DeleteUtterancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2069,7 +2069,7 @@ const deserializeAws_restJson1GetBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2140,7 +2140,7 @@ const deserializeAws_restJson1GetBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2193,7 +2193,7 @@ const deserializeAws_restJson1GetBotAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2264,7 +2264,7 @@ const deserializeAws_restJson1GetBotChannelAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2320,7 +2320,7 @@ const deserializeAws_restJson1GetBotChannelAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2370,7 +2370,7 @@ const deserializeAws_restJson1GetBotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2423,7 +2423,7 @@ const deserializeAws_restJson1GetBotVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2479,7 +2479,7 @@ const deserializeAws_restJson1GetBuiltinIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2532,7 +2532,7 @@ const deserializeAws_restJson1GetBuiltinIntentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2582,7 +2582,7 @@ const deserializeAws_restJson1GetBuiltinSlotTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2647,7 +2647,7 @@ const deserializeAws_restJson1GetExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2715,7 +2715,7 @@ const deserializeAws_restJson1GetImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2816,7 +2816,7 @@ const deserializeAws_restJson1GetIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2869,7 +2869,7 @@ const deserializeAws_restJson1GetIntentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2922,7 +2922,7 @@ const deserializeAws_restJson1GetIntentVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2999,7 +2999,7 @@ const deserializeAws_restJson1GetMigrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3052,7 +3052,7 @@ const deserializeAws_restJson1GetMigrationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3129,7 +3129,7 @@ const deserializeAws_restJson1GetSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3182,7 +3182,7 @@ const deserializeAws_restJson1GetSlotTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3235,7 +3235,7 @@ const deserializeAws_restJson1GetSlotTypeVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3288,7 +3288,7 @@ const deserializeAws_restJson1GetUtterancesViewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3335,7 +3335,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3442,7 +3442,7 @@ const deserializeAws_restJson1PutBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3519,7 +3519,7 @@ const deserializeAws_restJson1PutBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3626,7 +3626,7 @@ const deserializeAws_restJson1PutIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3712,7 +3712,7 @@ const deserializeAws_restJson1PutSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3783,7 +3783,7 @@ const deserializeAws_restJson1StartImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3851,7 +3851,7 @@ const deserializeAws_restJson1StartMigrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3901,7 +3901,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3951,7 +3951,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5146,6 +5146,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts index 58006c4a2ffb..11b0ad77e727 100644 --- a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts @@ -2356,7 +2356,7 @@ const deserializeAws_restJson1BuildBotLocaleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2439,7 +2439,7 @@ const deserializeAws_restJson1CreateBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2534,7 +2534,7 @@ const deserializeAws_restJson1CreateBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2614,7 +2614,7 @@ const deserializeAws_restJson1CreateBotLocaleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2688,7 +2688,7 @@ const deserializeAws_restJson1CreateBotVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2759,7 +2759,7 @@ const deserializeAws_restJson1CreateExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2872,7 +2872,7 @@ const deserializeAws_restJson1CreateIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2931,7 +2931,7 @@ const deserializeAws_restJson1CreateResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2990,7 +2990,7 @@ const deserializeAws_restJson1CreateResourcePolicyStatementCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3088,7 +3088,7 @@ const deserializeAws_restJson1CreateSlotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3183,7 +3183,7 @@ const deserializeAws_restJson1CreateSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3242,7 +3242,7 @@ const deserializeAws_restJson1CreateUploadUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3298,7 +3298,7 @@ const deserializeAws_restJson1DeleteBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3360,7 +3360,7 @@ const deserializeAws_restJson1DeleteBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3425,7 +3425,7 @@ const deserializeAws_restJson1DeleteBotLocaleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3487,7 +3487,7 @@ const deserializeAws_restJson1DeleteBotVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3552,7 +3552,7 @@ const deserializeAws_restJson1DeleteCustomVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3611,7 +3611,7 @@ const deserializeAws_restJson1DeleteExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3667,7 +3667,7 @@ const deserializeAws_restJson1DeleteImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3717,7 +3717,7 @@ const deserializeAws_restJson1DeleteIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3776,7 +3776,7 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3829,7 +3829,7 @@ const deserializeAws_restJson1DeleteResourcePolicyStatementCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3876,7 +3876,7 @@ const deserializeAws_restJson1DeleteSlotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3929,7 +3929,7 @@ const deserializeAws_restJson1DeleteSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3982,7 +3982,7 @@ const deserializeAws_restJson1DeleteUtterancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4053,7 +4053,7 @@ const deserializeAws_restJson1DescribeBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4151,7 +4151,7 @@ const deserializeAws_restJson1DescribeBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4254,7 +4254,7 @@ const deserializeAws_restJson1DescribeBotLocaleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4343,7 +4343,7 @@ const deserializeAws_restJson1DescribeBotRecommendationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4420,7 +4420,7 @@ const deserializeAws_restJson1DescribeBotVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4488,7 +4488,7 @@ const deserializeAws_restJson1DescribeCustomVocabularyMetadataCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4565,7 +4565,7 @@ const deserializeAws_restJson1DescribeExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4642,7 +4642,7 @@ const deserializeAws_restJson1DescribeImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4755,7 +4755,7 @@ const deserializeAws_restJson1DescribeIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4814,7 +4814,7 @@ const deserializeAws_restJson1DescribeResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4903,7 +4903,7 @@ const deserializeAws_restJson1DescribeSlotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4998,7 +4998,7 @@ const deserializeAws_restJson1DescribeSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5090,7 +5090,7 @@ const deserializeAws_restJson1ListAggregatedUtterancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5146,7 +5146,7 @@ const deserializeAws_restJson1ListBotAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5205,7 +5205,7 @@ const deserializeAws_restJson1ListBotLocalesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5270,7 +5270,7 @@ const deserializeAws_restJson1ListBotRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5323,7 +5323,7 @@ const deserializeAws_restJson1ListBotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5379,7 +5379,7 @@ const deserializeAws_restJson1ListBotVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5438,7 +5438,7 @@ const deserializeAws_restJson1ListBuiltInIntentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5497,7 +5497,7 @@ const deserializeAws_restJson1ListBuiltInSlotTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5559,7 +5559,7 @@ const deserializeAws_restJson1ListExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5618,7 +5618,7 @@ const deserializeAws_restJson1ListImportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5677,7 +5677,7 @@ const deserializeAws_restJson1ListIntentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5742,7 +5742,7 @@ const deserializeAws_restJson1ListRecommendedIntentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5810,7 +5810,7 @@ const deserializeAws_restJson1ListSlotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5872,7 +5872,7 @@ const deserializeAws_restJson1ListSlotTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5922,7 +5922,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5993,7 +5993,7 @@ const deserializeAws_restJson1SearchAssociatedTranscriptsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6070,7 +6070,7 @@ const deserializeAws_restJson1StartBotRecommendationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6144,7 +6144,7 @@ const deserializeAws_restJson1StartImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6212,7 +6212,7 @@ const deserializeAws_restJson1StopBotRecommendationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6268,7 +6268,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6315,7 +6315,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6389,7 +6389,7 @@ const deserializeAws_restJson1UpdateBotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6484,7 +6484,7 @@ const deserializeAws_restJson1UpdateBotAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6573,7 +6573,7 @@ const deserializeAws_restJson1UpdateBotLocaleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6656,7 +6656,7 @@ const deserializeAws_restJson1UpdateBotRecommendationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6733,7 +6733,7 @@ const deserializeAws_restJson1UpdateExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6852,7 +6852,7 @@ const deserializeAws_restJson1UpdateIntentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6911,7 +6911,7 @@ const deserializeAws_restJson1UpdateResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7009,7 +7009,7 @@ const deserializeAws_restJson1UpdateSlotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7107,7 +7107,7 @@ const deserializeAws_restJson1UpdateSlotTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10879,6 +10879,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts index b68cc5cf29a5..e328574c8e01 100644 --- a/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts @@ -255,7 +255,7 @@ const deserializeAws_restJson1DeleteSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -320,7 +320,7 @@ const deserializeAws_restJson1GetSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -413,7 +413,7 @@ const deserializeAws_restJson1PostContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -523,7 +523,7 @@ const deserializeAws_restJson1PostTextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -610,7 +610,7 @@ const deserializeAws_restJson1PutSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1138,6 +1138,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts index 4f10975e73e8..869759a09a7c 100644 --- a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts @@ -289,7 +289,7 @@ const deserializeAws_restJson1DeleteSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -354,7 +354,7 @@ const deserializeAws_restJson1GetSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -410,7 +410,7 @@ const deserializeAws_restJson1PutSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -484,7 +484,7 @@ const deserializeAws_restJson1RecognizeTextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -552,7 +552,7 @@ const deserializeAws_restJson1RecognizeUtteranceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -612,7 +612,7 @@ const deserializeAws_restJson1StartConversationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,6 +1840,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts index e43fbeabe8c3..fcd3c2742d53 100644 --- a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts @@ -378,7 +378,7 @@ const deserializeAws_restJson1AssociateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -440,7 +440,7 @@ const deserializeAws_restJson1DeregisterIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -499,7 +499,7 @@ const deserializeAws_restJson1DisassociateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -564,7 +564,7 @@ const deserializeAws_restJson1ListIdentityProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -626,7 +626,7 @@ const deserializeAws_restJson1ListInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -688,7 +688,7 @@ const deserializeAws_restJson1ListProductSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -753,7 +753,7 @@ const deserializeAws_restJson1ListUserAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -815,7 +815,7 @@ const deserializeAws_restJson1RegisterIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -874,7 +874,7 @@ const deserializeAws_restJson1StartProductSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -933,7 +933,7 @@ const deserializeAws_restJson1StopProductSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1294,6 +1294,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-license-manager/src/protocols/Aws_json1_1.ts b/clients/client-license-manager/src/protocols/Aws_json1_1.ts index 2d338519a4d8..430f74d3bf20 100644 --- a/clients/client-license-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/src/protocols/Aws_json1_1.ts @@ -950,7 +950,7 @@ const deserializeAws_json1_1AcceptGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1009,7 +1009,7 @@ const deserializeAws_json1_1CheckInLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1071,7 +1071,7 @@ const deserializeAws_json1_1CheckoutBorrowLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1142,7 +1142,7 @@ const deserializeAws_json1_1CheckoutLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1210,7 +1210,7 @@ const deserializeAws_json1_1CreateGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1269,7 +1269,7 @@ const deserializeAws_json1_1CreateGrantVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1328,7 +1328,7 @@ const deserializeAws_json1_1CreateLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1387,7 +1387,7 @@ const deserializeAws_json1_1CreateLicenseConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1443,7 +1443,7 @@ const deserializeAws_json1_1CreateLicenseConversionTaskForResourceCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1499,7 +1499,7 @@ const deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1561,7 +1561,7 @@ const deserializeAws_json1_1CreateLicenseVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1623,7 +1623,7 @@ const deserializeAws_json1_1CreateTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1685,7 +1685,7 @@ const deserializeAws_json1_1DeleteGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1744,7 +1744,7 @@ const deserializeAws_json1_1DeleteLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1806,7 +1806,7 @@ const deserializeAws_json1_1DeleteLicenseConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1859,7 +1859,7 @@ const deserializeAws_json1_1DeleteLicenseManagerReportGeneratorCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1921,7 +1921,7 @@ const deserializeAws_json1_1DeleteTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1980,7 +1980,7 @@ const deserializeAws_json1_1ExtendLicenseConsumptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2039,7 +2039,7 @@ const deserializeAws_json1_1GetAccessTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2092,7 +2092,7 @@ const deserializeAws_json1_1GetGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2151,7 +2151,7 @@ const deserializeAws_json1_1GetLicenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2207,7 +2207,7 @@ const deserializeAws_json1_1GetLicenseConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2260,7 +2260,7 @@ const deserializeAws_json1_1GetLicenseConversionTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2313,7 +2313,7 @@ const deserializeAws_json1_1GetLicenseManagerReportGeneratorCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2375,7 +2375,7 @@ const deserializeAws_json1_1GetLicenseUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2431,7 +2431,7 @@ const deserializeAws_json1_1GetServiceSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2481,7 +2481,7 @@ const deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2537,7 +2537,7 @@ const deserializeAws_json1_1ListDistributedGrantsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2596,7 +2596,7 @@ const deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2649,7 +2649,7 @@ const deserializeAws_json1_1ListLicenseConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2705,7 +2705,7 @@ const deserializeAws_json1_1ListLicenseConversionTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2758,7 +2758,7 @@ const deserializeAws_json1_1ListLicenseManagerReportGeneratorsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2820,7 +2820,7 @@ const deserializeAws_json1_1ListLicensesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2876,7 +2876,7 @@ const deserializeAws_json1_1ListLicenseSpecificationsForResourceCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2929,7 +2929,7 @@ const deserializeAws_json1_1ListLicenseVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2982,7 +2982,7 @@ const deserializeAws_json1_1ListReceivedGrantsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3041,7 +3041,7 @@ const deserializeAws_json1_1ListReceivedLicensesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3100,7 +3100,7 @@ const deserializeAws_json1_1ListResourceInventoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3159,7 +3159,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3212,7 +3212,7 @@ const deserializeAws_json1_1ListTokensCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3265,7 +3265,7 @@ const deserializeAws_json1_1ListUsageForLicenseConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3321,7 +3321,7 @@ const deserializeAws_json1_1RejectGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3380,7 +3380,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3433,7 +3433,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3486,7 +3486,7 @@ const deserializeAws_json1_1UpdateLicenseConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3542,7 +3542,7 @@ const deserializeAws_json1_1UpdateLicenseManagerReportGeneratorCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3604,7 +3604,7 @@ const deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3663,7 +3663,7 @@ const deserializeAws_json1_1UpdateServiceSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6259,6 +6259,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lightsail/src/protocols/Aws_json1_1.ts b/clients/client-lightsail/src/protocols/Aws_json1_1.ts index 8f67a07384a4..17ca36d85208 100644 --- a/clients/client-lightsail/src/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/src/protocols/Aws_json1_1.ts @@ -2880,7 +2880,7 @@ const deserializeAws_json1_1AllocateStaticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2939,7 +2939,7 @@ const deserializeAws_json1_1AttachCertificateToDistributionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2995,7 +2995,7 @@ const deserializeAws_json1_1AttachDiskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3054,7 +3054,7 @@ const deserializeAws_json1_1AttachInstancesToLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3113,7 +3113,7 @@ const deserializeAws_json1_1AttachLoadBalancerTlsCertificateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3172,7 +3172,7 @@ const deserializeAws_json1_1AttachStaticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3231,7 +3231,7 @@ const deserializeAws_json1_1CloseInstancePublicPortsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3290,7 +3290,7 @@ const deserializeAws_json1_1CopySnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3349,7 +3349,7 @@ const deserializeAws_json1_1CreateBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3399,7 +3399,7 @@ const deserializeAws_json1_1CreateBucketAccessKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3452,7 +3452,7 @@ const deserializeAws_json1_1CreateCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3505,7 +3505,7 @@ const deserializeAws_json1_1CreateCloudFormationStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3564,7 +3564,7 @@ const deserializeAws_json1_1CreateContactMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3620,7 +3620,7 @@ const deserializeAws_json1_1CreateContainerServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3673,7 +3673,7 @@ const deserializeAws_json1_1CreateContainerServiceDeploymentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3726,7 +3726,7 @@ const deserializeAws_json1_1CreateContainerServiceRegistryLoginCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3779,7 +3779,7 @@ const deserializeAws_json1_1CreateDiskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3838,7 +3838,7 @@ const deserializeAws_json1_1CreateDiskFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3897,7 +3897,7 @@ const deserializeAws_json1_1CreateDiskSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3956,7 +3956,7 @@ const deserializeAws_json1_1CreateDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4012,7 +4012,7 @@ const deserializeAws_json1_1CreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4071,7 +4071,7 @@ const deserializeAws_json1_1CreateDomainEntryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4130,7 +4130,7 @@ const deserializeAws_json1_1CreateInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4189,7 +4189,7 @@ const deserializeAws_json1_1CreateInstancesFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4248,7 +4248,7 @@ const deserializeAws_json1_1CreateInstanceSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4307,7 +4307,7 @@ const deserializeAws_json1_1CreateKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4366,7 +4366,7 @@ const deserializeAws_json1_1CreateLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4425,7 +4425,7 @@ const deserializeAws_json1_1CreateLoadBalancerTlsCertificateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4484,7 +4484,7 @@ const deserializeAws_json1_1CreateRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4543,7 +4543,7 @@ const deserializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4602,7 +4602,7 @@ const deserializeAws_json1_1CreateRelationalDatabaseSnapshotCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4661,7 +4661,7 @@ const deserializeAws_json1_1DeleteAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4717,7 +4717,7 @@ const deserializeAws_json1_1DeleteAutoSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4773,7 +4773,7 @@ const deserializeAws_json1_1DeleteBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4826,7 +4826,7 @@ const deserializeAws_json1_1DeleteBucketAccessKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4879,7 +4879,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4932,7 +4932,7 @@ const deserializeAws_json1_1DeleteContactMethodCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4988,7 +4988,7 @@ const deserializeAws_json1_1DeleteContainerImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5041,7 +5041,7 @@ const deserializeAws_json1_1DeleteContainerServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5094,7 +5094,7 @@ const deserializeAws_json1_1DeleteDiskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5153,7 +5153,7 @@ const deserializeAws_json1_1DeleteDiskSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5212,7 +5212,7 @@ const deserializeAws_json1_1DeleteDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5268,7 +5268,7 @@ const deserializeAws_json1_1DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5327,7 +5327,7 @@ const deserializeAws_json1_1DeleteDomainEntryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5386,7 +5386,7 @@ const deserializeAws_json1_1DeleteInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5445,7 +5445,7 @@ const deserializeAws_json1_1DeleteInstanceSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5504,7 +5504,7 @@ const deserializeAws_json1_1DeleteKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5563,7 +5563,7 @@ const deserializeAws_json1_1DeleteKnownHostKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5622,7 +5622,7 @@ const deserializeAws_json1_1DeleteLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5681,7 +5681,7 @@ const deserializeAws_json1_1DeleteLoadBalancerTlsCertificateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5740,7 +5740,7 @@ const deserializeAws_json1_1DeleteRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5799,7 +5799,7 @@ const deserializeAws_json1_1DeleteRelationalDatabaseSnapshotCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5858,7 +5858,7 @@ const deserializeAws_json1_1DetachCertificateFromDistributionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5914,7 +5914,7 @@ const deserializeAws_json1_1DetachDiskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5973,7 +5973,7 @@ const deserializeAws_json1_1DetachInstancesFromLoadBalancerCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6032,7 +6032,7 @@ const deserializeAws_json1_1DetachStaticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6091,7 +6091,7 @@ const deserializeAws_json1_1DisableAddOnCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6147,7 +6147,7 @@ const deserializeAws_json1_1DownloadDefaultKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6206,7 +6206,7 @@ const deserializeAws_json1_1EnableAddOnCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6262,7 +6262,7 @@ const deserializeAws_json1_1ExportSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6321,7 +6321,7 @@ const deserializeAws_json1_1GetActiveNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6380,7 +6380,7 @@ const deserializeAws_json1_1GetAlarmsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6436,7 +6436,7 @@ const deserializeAws_json1_1GetAutoSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6492,7 +6492,7 @@ const deserializeAws_json1_1GetBlueprintsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6551,7 +6551,7 @@ const deserializeAws_json1_1GetBucketAccessKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6604,7 +6604,7 @@ const deserializeAws_json1_1GetBucketBundlesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6654,7 +6654,7 @@ const deserializeAws_json1_1GetBucketMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6707,7 +6707,7 @@ const deserializeAws_json1_1GetBucketsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6760,7 +6760,7 @@ const deserializeAws_json1_1GetBundlesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6819,7 +6819,7 @@ const deserializeAws_json1_1GetCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6872,7 +6872,7 @@ const deserializeAws_json1_1GetCloudFormationStackRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6931,7 +6931,7 @@ const deserializeAws_json1_1GetContactMethodsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6987,7 +6987,7 @@ const deserializeAws_json1_1GetContainerAPIMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7034,7 +7034,7 @@ const deserializeAws_json1_1GetContainerImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7087,7 +7087,7 @@ const deserializeAws_json1_1GetContainerLogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7140,7 +7140,7 @@ const deserializeAws_json1_1GetContainerServiceDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7193,7 +7193,7 @@ const deserializeAws_json1_1GetContainerServiceMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7246,7 +7246,7 @@ const deserializeAws_json1_1GetContainerServicePowersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7299,7 +7299,7 @@ const deserializeAws_json1_1GetContainerServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7352,7 +7352,7 @@ const deserializeAws_json1_1GetDiskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7411,7 +7411,7 @@ const deserializeAws_json1_1GetDisksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7470,7 +7470,7 @@ const deserializeAws_json1_1GetDiskSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7529,7 +7529,7 @@ const deserializeAws_json1_1GetDiskSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7588,7 +7588,7 @@ const deserializeAws_json1_1GetDistributionBundlesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7644,7 +7644,7 @@ const deserializeAws_json1_1GetDistributionLatestCacheResetCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7700,7 +7700,7 @@ const deserializeAws_json1_1GetDistributionMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7756,7 +7756,7 @@ const deserializeAws_json1_1GetDistributionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7812,7 +7812,7 @@ const deserializeAws_json1_1GetDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7871,7 +7871,7 @@ const deserializeAws_json1_1GetDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7930,7 +7930,7 @@ const deserializeAws_json1_1GetExportSnapshotRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7989,7 +7989,7 @@ const deserializeAws_json1_1GetInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8048,7 +8048,7 @@ const deserializeAws_json1_1GetInstanceAccessDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8107,7 +8107,7 @@ const deserializeAws_json1_1GetInstanceMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8166,7 +8166,7 @@ const deserializeAws_json1_1GetInstancePortStatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8225,7 +8225,7 @@ const deserializeAws_json1_1GetInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8284,7 +8284,7 @@ const deserializeAws_json1_1GetInstanceSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8343,7 +8343,7 @@ const deserializeAws_json1_1GetInstanceSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8402,7 +8402,7 @@ const deserializeAws_json1_1GetInstanceStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8461,7 +8461,7 @@ const deserializeAws_json1_1GetKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8520,7 +8520,7 @@ const deserializeAws_json1_1GetKeyPairsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8579,7 +8579,7 @@ const deserializeAws_json1_1GetLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8638,7 +8638,7 @@ const deserializeAws_json1_1GetLoadBalancerMetricDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8697,7 +8697,7 @@ const deserializeAws_json1_1GetLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8756,7 +8756,7 @@ const deserializeAws_json1_1GetLoadBalancerTlsCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8815,7 +8815,7 @@ const deserializeAws_json1_1GetLoadBalancerTlsPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8868,7 +8868,7 @@ const deserializeAws_json1_1GetOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8927,7 +8927,7 @@ const deserializeAws_json1_1GetOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8986,7 +8986,7 @@ const deserializeAws_json1_1GetOperationsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9045,7 +9045,7 @@ const deserializeAws_json1_1GetRegionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9104,7 +9104,7 @@ const deserializeAws_json1_1GetRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9163,7 +9163,7 @@ const deserializeAws_json1_1GetRelationalDatabaseBlueprintsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9222,7 +9222,7 @@ const deserializeAws_json1_1GetRelationalDatabaseBundlesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9281,7 +9281,7 @@ const deserializeAws_json1_1GetRelationalDatabaseEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9340,7 +9340,7 @@ const deserializeAws_json1_1GetRelationalDatabaseLogEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9399,7 +9399,7 @@ const deserializeAws_json1_1GetRelationalDatabaseLogStreamsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9458,7 +9458,7 @@ const deserializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9517,7 +9517,7 @@ const deserializeAws_json1_1GetRelationalDatabaseMetricDataCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9576,7 +9576,7 @@ const deserializeAws_json1_1GetRelationalDatabaseParametersCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9635,7 +9635,7 @@ const deserializeAws_json1_1GetRelationalDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9694,7 +9694,7 @@ const deserializeAws_json1_1GetRelationalDatabaseSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9753,7 +9753,7 @@ const deserializeAws_json1_1GetRelationalDatabaseSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9812,7 +9812,7 @@ const deserializeAws_json1_1GetStaticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9871,7 +9871,7 @@ const deserializeAws_json1_1GetStaticIpsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9930,7 +9930,7 @@ const deserializeAws_json1_1ImportKeyPairCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9989,7 +9989,7 @@ const deserializeAws_json1_1IsVpcPeeredCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10048,7 +10048,7 @@ const deserializeAws_json1_1OpenInstancePublicPortsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10107,7 +10107,7 @@ const deserializeAws_json1_1PeerVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10166,7 +10166,7 @@ const deserializeAws_json1_1PutAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10222,7 +10222,7 @@ const deserializeAws_json1_1PutInstancePublicPortsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10281,7 +10281,7 @@ const deserializeAws_json1_1RebootInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10340,7 +10340,7 @@ const deserializeAws_json1_1RebootRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10399,7 +10399,7 @@ const deserializeAws_json1_1RegisterContainerImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10452,7 +10452,7 @@ const deserializeAws_json1_1ReleaseStaticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10511,7 +10511,7 @@ const deserializeAws_json1_1ResetDistributionCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10567,7 +10567,7 @@ const deserializeAws_json1_1SendContactMethodVerificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10623,7 +10623,7 @@ const deserializeAws_json1_1SetIpAddressTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10682,7 +10682,7 @@ const deserializeAws_json1_1SetResourceAccessForBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10735,7 +10735,7 @@ const deserializeAws_json1_1StartInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10794,7 +10794,7 @@ const deserializeAws_json1_1StartRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10853,7 +10853,7 @@ const deserializeAws_json1_1StopInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10912,7 +10912,7 @@ const deserializeAws_json1_1StopRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10971,7 +10971,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11030,7 +11030,7 @@ const deserializeAws_json1_1TestAlarmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11086,7 +11086,7 @@ const deserializeAws_json1_1UnpeerVpcCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11145,7 +11145,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11204,7 +11204,7 @@ const deserializeAws_json1_1UpdateBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11257,7 +11257,7 @@ const deserializeAws_json1_1UpdateBucketBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11310,7 +11310,7 @@ const deserializeAws_json1_1UpdateContainerServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11363,7 +11363,7 @@ const deserializeAws_json1_1UpdateDistributionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11419,7 +11419,7 @@ const deserializeAws_json1_1UpdateDistributionBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11475,7 +11475,7 @@ const deserializeAws_json1_1UpdateDomainEntryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11534,7 +11534,7 @@ const deserializeAws_json1_1UpdateInstanceMetadataOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11593,7 +11593,7 @@ const deserializeAws_json1_1UpdateLoadBalancerAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11652,7 +11652,7 @@ const deserializeAws_json1_1UpdateRelationalDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11711,7 +11711,7 @@ const deserializeAws_json1_1UpdateRelationalDatabaseParametersCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -17668,6 +17668,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-location/src/protocols/Aws_restJson1.ts b/clients/client-location/src/protocols/Aws_restJson1.ts index 0321fc72ebeb..fcfb64f156b3 100644 --- a/clients/client-location/src/protocols/Aws_restJson1.ts +++ b/clients/client-location/src/protocols/Aws_restJson1.ts @@ -2118,7 +2118,7 @@ const deserializeAws_restJson1AssociateTrackerConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2177,7 +2177,7 @@ const deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2230,7 +2230,7 @@ const deserializeAws_restJson1BatchDeleteGeofenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2283,7 +2283,7 @@ const deserializeAws_restJson1BatchEvaluateGeofencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2339,7 +2339,7 @@ const deserializeAws_restJson1BatchGetDevicePositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2395,7 +2395,7 @@ const deserializeAws_restJson1BatchPutGeofenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2448,7 +2448,7 @@ const deserializeAws_restJson1BatchUpdateDevicePositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2504,7 +2504,7 @@ const deserializeAws_restJson1CalculateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2569,7 +2569,7 @@ const deserializeAws_restJson1CalculateRouteMatrixCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2628,7 +2628,7 @@ const deserializeAws_restJson1CreateGeofenceCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2687,7 +2687,7 @@ const deserializeAws_restJson1CreateMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2746,7 +2746,7 @@ const deserializeAws_restJson1CreatePlaceIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2805,7 +2805,7 @@ const deserializeAws_restJson1CreateRouteCalculatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2864,7 +2864,7 @@ const deserializeAws_restJson1CreateTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2914,7 +2914,7 @@ const deserializeAws_restJson1DeleteGeofenceCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2964,7 +2964,7 @@ const deserializeAws_restJson1DeleteMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3014,7 +3014,7 @@ const deserializeAws_restJson1DeletePlaceIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3064,7 +3064,7 @@ const deserializeAws_restJson1DeleteRouteCalculatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3114,7 +3114,7 @@ const deserializeAws_restJson1DeleteTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3191,7 +3191,7 @@ const deserializeAws_restJson1DescribeGeofenceCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3268,7 +3268,7 @@ const deserializeAws_restJson1DescribeMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3348,7 +3348,7 @@ const deserializeAws_restJson1DescribePlaceIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3422,7 +3422,7 @@ const deserializeAws_restJson1DescribeRouteCalculatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3502,7 +3502,7 @@ const deserializeAws_restJson1DescribeTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3552,7 +3552,7 @@ const deserializeAws_restJson1DisassociateTrackerConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3620,7 +3620,7 @@ const deserializeAws_restJson1GetDevicePositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3676,7 +3676,7 @@ const deserializeAws_restJson1GetDevicePositionHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3741,7 +3741,7 @@ const deserializeAws_restJson1GetGeofenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3793,7 +3793,7 @@ const deserializeAws_restJson1GetMapGlyphsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3845,7 +3845,7 @@ const deserializeAws_restJson1GetMapSpritesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3897,7 +3897,7 @@ const deserializeAws_restJson1GetMapStyleDescriptorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3949,7 +3949,7 @@ const deserializeAws_restJson1GetMapTileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4002,7 +4002,7 @@ const deserializeAws_restJson1GetPlaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4058,7 +4058,7 @@ const deserializeAws_restJson1ListDevicePositionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4111,7 +4111,7 @@ const deserializeAws_restJson1ListGeofenceCollectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4164,7 +4164,7 @@ const deserializeAws_restJson1ListGeofencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4220,7 +4220,7 @@ const deserializeAws_restJson1ListMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4273,7 +4273,7 @@ const deserializeAws_restJson1ListPlaceIndexesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4326,7 +4326,7 @@ const deserializeAws_restJson1ListRouteCalculatorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4376,7 +4376,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4432,7 +4432,7 @@ const deserializeAws_restJson1ListTrackerConsumersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4488,7 +4488,7 @@ const deserializeAws_restJson1ListTrackersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4544,7 +4544,7 @@ const deserializeAws_restJson1PutGeofenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4603,7 +4603,7 @@ const deserializeAws_restJson1SearchPlaceIndexForPositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4659,7 +4659,7 @@ const deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4715,7 +4715,7 @@ const deserializeAws_restJson1SearchPlaceIndexForTextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4765,7 +4765,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4815,7 +4815,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4874,7 +4874,7 @@ const deserializeAws_restJson1UpdateGeofenceCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4933,7 +4933,7 @@ const deserializeAws_restJson1UpdateMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4992,7 +4992,7 @@ const deserializeAws_restJson1UpdatePlaceIndexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5051,7 +5051,7 @@ const deserializeAws_restJson1UpdateRouteCalculatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5110,7 +5110,7 @@ const deserializeAws_restJson1UpdateTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6370,6 +6370,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts index d8c3d4d59fed..9c1bb38e4a54 100644 --- a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts +++ b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts @@ -654,7 +654,7 @@ const deserializeAws_json1_0CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -710,7 +710,7 @@ const deserializeAws_json1_0CreateInferenceSchedulerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -769,7 +769,7 @@ const deserializeAws_json1_0CreateLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -828,7 +828,7 @@ const deserializeAws_json1_0CreateLabelGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -884,7 +884,7 @@ const deserializeAws_json1_0CreateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -940,7 +940,7 @@ const deserializeAws_json1_0DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -990,7 +990,7 @@ const deserializeAws_json1_0DeleteInferenceSchedulerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1043,7 +1043,7 @@ const deserializeAws_json1_0DeleteLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1093,7 +1093,7 @@ const deserializeAws_json1_0DeleteLabelGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1143,7 +1143,7 @@ const deserializeAws_json1_0DeleteModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1196,7 +1196,7 @@ const deserializeAws_json1_0DescribeDataIngestionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1249,7 +1249,7 @@ const deserializeAws_json1_0DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1302,7 +1302,7 @@ const deserializeAws_json1_0DescribeInferenceSchedulerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1355,7 +1355,7 @@ const deserializeAws_json1_0DescribeLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1408,7 +1408,7 @@ const deserializeAws_json1_0DescribeLabelGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1461,7 +1461,7 @@ const deserializeAws_json1_0DescribeModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1514,7 +1514,7 @@ const deserializeAws_json1_0ListDataIngestionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1564,7 +1564,7 @@ const deserializeAws_json1_0ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1614,7 +1614,7 @@ const deserializeAws_json1_0ListInferenceEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1667,7 +1667,7 @@ const deserializeAws_json1_0ListInferenceExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1720,7 +1720,7 @@ const deserializeAws_json1_0ListInferenceSchedulersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1770,7 +1770,7 @@ const deserializeAws_json1_0ListLabelGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1820,7 +1820,7 @@ const deserializeAws_json1_0ListLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1870,7 +1870,7 @@ const deserializeAws_json1_0ListModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1920,7 +1920,7 @@ const deserializeAws_json1_0ListSensorStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1973,7 +1973,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2026,7 +2026,7 @@ const deserializeAws_json1_0StartDataIngestionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2085,7 +2085,7 @@ const deserializeAws_json1_0StartInferenceSchedulerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2141,7 +2141,7 @@ const deserializeAws_json1_0StopInferenceSchedulerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2197,7 +2197,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2253,7 +2253,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2303,7 +2303,7 @@ const deserializeAws_json1_0UpdateInferenceSchedulerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2356,7 +2356,7 @@ const deserializeAws_json1_0UpdateLabelGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4088,6 +4088,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts index 8feb3f31313a..58f82dca01b9 100644 --- a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts @@ -1012,7 +1012,7 @@ const deserializeAws_restJson1ActivateAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1065,7 +1065,7 @@ const deserializeAws_restJson1BackTestAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1118,7 +1118,7 @@ const deserializeAws_restJson1CreateAlertCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1177,7 +1177,7 @@ const deserializeAws_restJson1CreateAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1233,7 +1233,7 @@ const deserializeAws_restJson1CreateMetricSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1289,7 +1289,7 @@ const deserializeAws_restJson1DeactivateAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1342,7 +1342,7 @@ const deserializeAws_restJson1DeleteAlertCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1392,7 +1392,7 @@ const deserializeAws_restJson1DeleteAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1448,7 +1448,7 @@ const deserializeAws_restJson1DescribeAlertCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1504,7 +1504,7 @@ const deserializeAws_restJson1DescribeAnomalyDetectionExecutionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1587,7 +1587,7 @@ const deserializeAws_restJson1DescribeAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1682,7 +1682,7 @@ const deserializeAws_restJson1DescribeMetricSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1738,7 +1738,7 @@ const deserializeAws_restJson1DetectMetricSetConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1791,7 +1791,7 @@ const deserializeAws_restJson1GetAnomalyGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1847,7 +1847,7 @@ const deserializeAws_restJson1GetDataQualityMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1906,7 +1906,7 @@ const deserializeAws_restJson1GetFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1962,7 +1962,7 @@ const deserializeAws_restJson1GetSampleDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2018,7 +2018,7 @@ const deserializeAws_restJson1ListAlertsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2077,7 +2077,7 @@ const deserializeAws_restJson1ListAnomalyDetectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2133,7 +2133,7 @@ const deserializeAws_restJson1ListAnomalyGroupRelatedMetricsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2198,7 +2198,7 @@ const deserializeAws_restJson1ListAnomalyGroupSummariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2263,7 +2263,7 @@ const deserializeAws_restJson1ListAnomalyGroupTimeSeriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2319,7 +2319,7 @@ const deserializeAws_restJson1ListMetricSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2372,7 +2372,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2416,7 +2416,7 @@ const deserializeAws_restJson1PutFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2466,7 +2466,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2510,7 +2510,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2557,7 +2557,7 @@ const deserializeAws_restJson1UpdateAlertCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2610,7 +2610,7 @@ const deserializeAws_restJson1UpdateAnomalyDetectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2663,7 +2663,7 @@ const deserializeAws_restJson1UpdateMetricSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4373,6 +4373,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts index f116843a5a40..e8028de7a9b3 100644 --- a/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts @@ -739,7 +739,7 @@ const deserializeAws_restJson1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -798,7 +798,7 @@ const deserializeAws_restJson1CreateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -857,7 +857,7 @@ const deserializeAws_restJson1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -913,7 +913,7 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -969,7 +969,7 @@ const deserializeAws_restJson1DeleteModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1025,7 +1025,7 @@ const deserializeAws_restJson1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1081,7 +1081,7 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1137,7 +1137,7 @@ const deserializeAws_restJson1DescribeModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1196,7 +1196,7 @@ const deserializeAws_restJson1DescribeModelPackagingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1249,7 +1249,7 @@ const deserializeAws_restJson1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1305,7 +1305,7 @@ const deserializeAws_restJson1DetectAnomaliesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1364,7 +1364,7 @@ const deserializeAws_restJson1ListDatasetEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1423,7 +1423,7 @@ const deserializeAws_restJson1ListModelPackagingJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_restJson1ListModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_restJson1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1594,7 +1594,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1650,7 +1650,7 @@ const deserializeAws_restJson1StartModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1709,7 +1709,7 @@ const deserializeAws_restJson1StartModelPackagingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1768,7 +1768,7 @@ const deserializeAws_restJson1StopModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1821,7 +1821,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1877,7 +1877,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1933,7 +1933,7 @@ const deserializeAws_restJson1UpdateDatasetEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2630,6 +2630,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-m2/src/protocols/Aws_restJson1.ts b/clients/client-m2/src/protocols/Aws_restJson1.ts index b8d4430b67fa..f91dab2f2604 100644 --- a/clients/client-m2/src/protocols/Aws_restJson1.ts +++ b/clients/client-m2/src/protocols/Aws_restJson1.ts @@ -1179,7 +1179,7 @@ const deserializeAws_restJson1CancelBatchJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1241,7 +1241,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1297,7 +1297,7 @@ const deserializeAws_restJson1CreateDataSetImportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1356,7 +1356,7 @@ const deserializeAws_restJson1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1415,7 +1415,7 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1468,7 +1468,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1518,7 +1518,7 @@ const deserializeAws_restJson1DeleteApplicationFromEnvironmentCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1571,7 +1571,7 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1675,7 +1675,7 @@ const deserializeAws_restJson1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1746,7 +1746,7 @@ const deserializeAws_restJson1GetApplicationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1826,7 +1826,7 @@ const deserializeAws_restJson1GetBatchJobExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1900,7 +1900,7 @@ const deserializeAws_restJson1GetDataSetDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1959,7 +1959,7 @@ const deserializeAws_restJson1GetDataSetImportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_restJson1GetDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2149,7 +2149,7 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2205,7 +2205,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2261,7 +2261,7 @@ const deserializeAws_restJson1ListApplicationVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2317,7 +2317,7 @@ const deserializeAws_restJson1ListBatchJobDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2376,7 +2376,7 @@ const deserializeAws_restJson1ListBatchJobExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2432,7 +2432,7 @@ const deserializeAws_restJson1ListDataSetImportHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2488,7 +2488,7 @@ const deserializeAws_restJson1ListDataSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2544,7 +2544,7 @@ const deserializeAws_restJson1ListDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2600,7 +2600,7 @@ const deserializeAws_restJson1ListEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2653,7 +2653,7 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2703,7 +2703,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2753,7 +2753,7 @@ const deserializeAws_restJson1StartApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2809,7 +2809,7 @@ const deserializeAws_restJson1StartBatchJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2862,7 +2862,7 @@ const deserializeAws_restJson1StopApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2915,7 +2915,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2968,7 +2968,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3077,7 +3077,7 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4054,6 +4054,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts index 5cba88ac5018..ea1d6903e720 100644 --- a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts @@ -554,7 +554,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -607,7 +607,7 @@ const deserializeAws_json1_1CreateBatchPredictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -654,7 +654,7 @@ const deserializeAws_json1_1CreateDataSourceFromRDSCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -701,7 +701,7 @@ const deserializeAws_json1_1CreateDataSourceFromRedshiftCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -748,7 +748,7 @@ const deserializeAws_json1_1CreateDataSourceFromS3CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -795,7 +795,7 @@ const deserializeAws_json1_1CreateEvaluationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -842,7 +842,7 @@ const deserializeAws_json1_1CreateMLModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -889,7 +889,7 @@ const deserializeAws_json1_1CreateRealtimeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -936,7 +936,7 @@ const deserializeAws_json1_1DeleteBatchPredictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -983,7 +983,7 @@ const deserializeAws_json1_1DeleteDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1030,7 +1030,7 @@ const deserializeAws_json1_1DeleteEvaluationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1077,7 +1077,7 @@ const deserializeAws_json1_1DeleteMLModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1124,7 +1124,7 @@ const deserializeAws_json1_1DeleteRealtimeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1171,7 +1171,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1221,7 +1221,7 @@ const deserializeAws_json1_1DescribeBatchPredictionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1265,7 +1265,7 @@ const deserializeAws_json1_1DescribeDataSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1309,7 +1309,7 @@ const deserializeAws_json1_1DescribeEvaluationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1353,7 +1353,7 @@ const deserializeAws_json1_1DescribeMLModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1397,7 +1397,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1444,7 +1444,7 @@ const deserializeAws_json1_1GetBatchPredictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1491,7 +1491,7 @@ const deserializeAws_json1_1GetDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_json1_1GetEvaluationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1585,7 +1585,7 @@ const deserializeAws_json1_1GetMLModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1632,7 +1632,7 @@ const deserializeAws_json1_1PredictCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1685,7 +1685,7 @@ const deserializeAws_json1_1UpdateBatchPredictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1732,7 +1732,7 @@ const deserializeAws_json1_1UpdateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1779,7 +1779,7 @@ const deserializeAws_json1_1UpdateEvaluationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1826,7 +1826,7 @@ const deserializeAws_json1_1UpdateMLModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3132,6 +3132,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-macie/src/protocols/Aws_json1_1.ts b/clients/client-macie/src/protocols/Aws_json1_1.ts index 968b8b6c56d8..0d10388494e6 100644 --- a/clients/client-macie/src/protocols/Aws_json1_1.ts +++ b/clients/client-macie/src/protocols/Aws_json1_1.ts @@ -169,7 +169,7 @@ const deserializeAws_json1_1AssociateMemberAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -216,7 +216,7 @@ const deserializeAws_json1_1AssociateS3ResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -263,7 +263,7 @@ const deserializeAws_json1_1DisassociateMemberAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -307,7 +307,7 @@ const deserializeAws_json1_1DisassociateS3ResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -354,7 +354,7 @@ const deserializeAws_json1_1ListMemberAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -398,7 +398,7 @@ const deserializeAws_json1_1ListS3ResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -445,7 +445,7 @@ const deserializeAws_json1_1UpdateS3ResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -893,6 +893,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-macie2/src/protocols/Aws_restJson1.ts b/clients/client-macie2/src/protocols/Aws_restJson1.ts index da95cf0a40bc..bcb7cdde2f79 100644 --- a/clients/client-macie2/src/protocols/Aws_restJson1.ts +++ b/clients/client-macie2/src/protocols/Aws_restJson1.ts @@ -2015,7 +2015,7 @@ const deserializeAws_restJson1AcceptInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2080,7 +2080,7 @@ const deserializeAws_restJson1BatchGetCustomDataIdentifiersCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2142,7 +2142,7 @@ const deserializeAws_restJson1CreateAllowListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2204,7 +2204,7 @@ const deserializeAws_restJson1CreateClassificationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2263,7 +2263,7 @@ const deserializeAws_restJson1CreateCustomDataIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2325,7 +2325,7 @@ const deserializeAws_restJson1CreateFindingsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2387,7 +2387,7 @@ const deserializeAws_restJson1CreateInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2446,7 +2446,7 @@ const deserializeAws_restJson1CreateMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2502,7 +2502,7 @@ const deserializeAws_restJson1CreateSampleFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2564,7 +2564,7 @@ const deserializeAws_restJson1DeclineInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2620,7 +2620,7 @@ const deserializeAws_restJson1DeleteAllowListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2670,7 +2670,7 @@ const deserializeAws_restJson1DeleteCustomDataIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2726,7 +2726,7 @@ const deserializeAws_restJson1DeleteFindingsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2788,7 +2788,7 @@ const deserializeAws_restJson1DeleteInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2844,7 +2844,7 @@ const deserializeAws_restJson1DeleteMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2906,7 +2906,7 @@ const deserializeAws_restJson1DescribeBucketsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3028,7 +3028,7 @@ const deserializeAws_restJson1DescribeClassificationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3090,7 +3090,7 @@ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3146,7 +3146,7 @@ const deserializeAws_restJson1DisableMacieCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3202,7 +3202,7 @@ const deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3258,7 +3258,7 @@ const deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3314,7 +3314,7 @@ const deserializeAws_restJson1DisassociateFromMasterAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3370,7 +3370,7 @@ const deserializeAws_restJson1DisassociateMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3426,7 +3426,7 @@ const deserializeAws_restJson1EnableMacieCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3482,7 +3482,7 @@ const deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3541,7 +3541,7 @@ const deserializeAws_restJson1GetAdministratorAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3624,7 +3624,7 @@ const deserializeAws_restJson1GetAllowListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3732,7 +3732,7 @@ const deserializeAws_restJson1GetBucketStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3791,7 +3791,7 @@ const deserializeAws_restJson1GetClassificationExportConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3883,7 +3883,7 @@ const deserializeAws_restJson1GetCustomDataIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3942,7 +3942,7 @@ const deserializeAws_restJson1GetFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4022,7 +4022,7 @@ const deserializeAws_restJson1GetFindingsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4084,7 +4084,7 @@ const deserializeAws_restJson1GetFindingsPublicationConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4143,7 +4143,7 @@ const deserializeAws_restJson1GetFindingStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4202,7 +4202,7 @@ const deserializeAws_restJson1GetInvitationsCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4273,7 +4273,7 @@ const deserializeAws_restJson1GetMacieSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4332,7 +4332,7 @@ const deserializeAws_restJson1GetMasterAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4415,7 +4415,7 @@ const deserializeAws_restJson1GetMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4474,7 +4474,7 @@ const deserializeAws_restJson1GetRevealConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4533,7 +4533,7 @@ const deserializeAws_restJson1GetSensitiveDataOccurrencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4592,7 +4592,7 @@ const deserializeAws_restJson1GetSensitiveDataOccurrencesAvailabilityCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4648,7 +4648,7 @@ const deserializeAws_restJson1GetUsageStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4710,7 +4710,7 @@ const deserializeAws_restJson1GetUsageTotalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4772,7 +4772,7 @@ const deserializeAws_restJson1ListAllowListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4825,7 +4825,7 @@ const deserializeAws_restJson1ListClassificationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4887,7 +4887,7 @@ const deserializeAws_restJson1ListCustomDataIdentifiersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4949,7 +4949,7 @@ const deserializeAws_restJson1ListFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5014,7 +5014,7 @@ const deserializeAws_restJson1ListFindingsFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5076,7 +5076,7 @@ const deserializeAws_restJson1ListInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5138,7 +5138,7 @@ const deserializeAws_restJson1ListManagedDataIdentifiersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5176,7 +5176,7 @@ const deserializeAws_restJson1ListMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5238,7 +5238,7 @@ const deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5297,7 +5297,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5332,7 +5332,7 @@ const deserializeAws_restJson1PutClassificationExportConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5388,7 +5388,7 @@ const deserializeAws_restJson1PutFindingsPublicationConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5450,7 +5450,7 @@ const deserializeAws_restJson1SearchResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5506,7 +5506,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5541,7 +5541,7 @@ const deserializeAws_restJson1TestCustomDataIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5597,7 +5597,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5635,7 +5635,7 @@ const deserializeAws_restJson1UpdateAllowListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5685,7 +5685,7 @@ const deserializeAws_restJson1UpdateClassificationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5747,7 +5747,7 @@ const deserializeAws_restJson1UpdateFindingsFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5803,7 +5803,7 @@ const deserializeAws_restJson1UpdateMacieSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5859,7 +5859,7 @@ const deserializeAws_restJson1UpdateMemberSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5915,7 +5915,7 @@ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5974,7 +5974,7 @@ const deserializeAws_restJson1UpdateRevealConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8324,6 +8324,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts index e2836b02bac8..e59f9a9f847b 100644 --- a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts @@ -742,7 +742,7 @@ const deserializeAws_restJson1CreateMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -810,7 +810,7 @@ const deserializeAws_restJson1CreateNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -869,7 +869,7 @@ const deserializeAws_restJson1CreateNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_restJson1CreateProposalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -990,7 +990,7 @@ const deserializeAws_restJson1DeleteMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1043,7 +1043,7 @@ const deserializeAws_restJson1DeleteNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1099,7 +1099,7 @@ const deserializeAws_restJson1GetMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1152,7 +1152,7 @@ const deserializeAws_restJson1GetNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1205,7 +1205,7 @@ const deserializeAws_restJson1GetNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1258,7 +1258,7 @@ const deserializeAws_restJson1GetProposalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1314,7 +1314,7 @@ const deserializeAws_restJson1ListInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1373,7 +1373,7 @@ const deserializeAws_restJson1ListMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1426,7 +1426,7 @@ const deserializeAws_restJson1ListNetworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_restJson1ListNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1532,7 +1532,7 @@ const deserializeAws_restJson1ListProposalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1588,7 +1588,7 @@ const deserializeAws_restJson1ListProposalVotesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1638,7 +1638,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1685,7 +1685,7 @@ const deserializeAws_restJson1RejectInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1738,7 +1738,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1788,7 +1788,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1835,7 +1835,7 @@ const deserializeAws_restJson1UpdateMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1885,7 +1885,7 @@ const deserializeAws_restJson1UpdateNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1935,7 +1935,7 @@ const deserializeAws_restJson1VoteOnProposalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2808,6 +2808,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts index 36f3d5f936bb..7eaf0472e87c 100644 --- a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts @@ -224,7 +224,7 @@ const deserializeAws_restJson1CancelChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -304,7 +304,7 @@ const deserializeAws_restJson1DescribeChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -369,7 +369,7 @@ const deserializeAws_restJson1DescribeEntityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -428,7 +428,7 @@ const deserializeAws_restJson1ListChangeSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -481,7 +481,7 @@ const deserializeAws_restJson1ListEntitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -537,7 +537,7 @@ const deserializeAws_restJson1StartChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -908,6 +908,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts index 451ff9e95971..8c055dd00384 100644 --- a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts @@ -75,7 +75,7 @@ const deserializeAws_json1_1GenerateDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -116,7 +116,7 @@ const deserializeAws_json1_1StartSupportDataExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -268,6 +268,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts index 30be3fa80c34..8627c794c8e5 100644 --- a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts @@ -68,7 +68,7 @@ const deserializeAws_json1_1GetEntitlementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -289,6 +289,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts index f795a3ac67c9..ab052cc481c5 100644 --- a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts @@ -128,7 +128,7 @@ const deserializeAws_json1_1BatchMeterUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -193,7 +193,7 @@ const deserializeAws_json1_1MeterUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -261,7 +261,7 @@ const deserializeAws_json1_1RegisterUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -323,7 +323,7 @@ const deserializeAws_json1_1ResolveCustomerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -966,6 +966,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts index f66032b3ddf4..e8610784e8b2 100644 --- a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts @@ -1003,7 +1003,7 @@ const deserializeAws_restJson1AddFlowMediaStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1062,7 +1062,7 @@ const deserializeAws_restJson1AddFlowOutputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1124,7 +1124,7 @@ const deserializeAws_restJson1AddFlowSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1183,7 +1183,7 @@ const deserializeAws_restJson1AddFlowVpcInterfacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1239,7 +1239,7 @@ const deserializeAws_restJson1CreateFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1298,7 +1298,7 @@ const deserializeAws_restJson1DeleteFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1357,7 +1357,7 @@ const deserializeAws_restJson1DescribeFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1413,7 +1413,7 @@ const deserializeAws_restJson1DescribeOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1466,7 +1466,7 @@ const deserializeAws_restJson1DescribeReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1522,7 +1522,7 @@ const deserializeAws_restJson1GrantFlowEntitlementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1584,7 +1584,7 @@ const deserializeAws_restJson1ListEntitlementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1637,7 +1637,7 @@ const deserializeAws_restJson1ListFlowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1690,7 +1690,7 @@ const deserializeAws_restJson1ListOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1743,7 +1743,7 @@ const deserializeAws_restJson1ListReservationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1PurchaseOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1899,7 +1899,7 @@ const deserializeAws_restJson1RemoveFlowMediaStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1958,7 +1958,7 @@ const deserializeAws_restJson1RemoveFlowOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2017,7 +2017,7 @@ const deserializeAws_restJson1RemoveFlowSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2082,7 +2082,7 @@ const deserializeAws_restJson1RemoveFlowVpcInterfaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2141,7 +2141,7 @@ const deserializeAws_restJson1RevokeFlowEntitlementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2200,7 +2200,7 @@ const deserializeAws_restJson1StartFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2259,7 +2259,7 @@ const deserializeAws_restJson1StopFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2312,7 +2312,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2356,7 +2356,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2403,7 +2403,7 @@ const deserializeAws_restJson1UpdateFlowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2462,7 +2462,7 @@ const deserializeAws_restJson1UpdateFlowEntitlementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2521,7 +2521,7 @@ const deserializeAws_restJson1UpdateFlowMediaStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2580,7 +2580,7 @@ const deserializeAws_restJson1UpdateFlowOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2639,7 +2639,7 @@ const deserializeAws_restJson1UpdateFlowSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3786,6 +3786,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts index 36c94c026512..29563a26e857 100644 --- a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts @@ -982,7 +982,7 @@ const deserializeAws_restJson1AssociateCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1035,7 +1035,7 @@ const deserializeAws_restJson1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1091,7 +1091,7 @@ const deserializeAws_restJson1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1147,7 +1147,7 @@ const deserializeAws_restJson1CreateJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1203,7 +1203,7 @@ const deserializeAws_restJson1CreatePresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1259,7 +1259,7 @@ const deserializeAws_restJson1CreateQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1312,7 +1312,7 @@ const deserializeAws_restJson1DeleteJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1365,7 +1365,7 @@ const deserializeAws_restJson1DeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1418,7 +1418,7 @@ const deserializeAws_restJson1DeletePresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1471,7 +1471,7 @@ const deserializeAws_restJson1DeleteQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1530,7 +1530,7 @@ const deserializeAws_restJson1DescribeEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1583,7 +1583,7 @@ const deserializeAws_restJson1DisassociateCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1639,7 +1639,7 @@ const deserializeAws_restJson1GetJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1695,7 +1695,7 @@ const deserializeAws_restJson1GetJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1751,7 +1751,7 @@ const deserializeAws_restJson1GetPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1807,7 +1807,7 @@ const deserializeAws_restJson1GetPresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1863,7 +1863,7 @@ const deserializeAws_restJson1GetQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1922,7 +1922,7 @@ const deserializeAws_restJson1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1981,7 +1981,7 @@ const deserializeAws_restJson1ListJobTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2040,7 +2040,7 @@ const deserializeAws_restJson1ListPresetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2099,7 +2099,7 @@ const deserializeAws_restJson1ListQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2155,7 +2155,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2211,7 +2211,7 @@ const deserializeAws_restJson1PutPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2264,7 +2264,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2317,7 +2317,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2373,7 +2373,7 @@ const deserializeAws_restJson1UpdateJobTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1UpdatePresetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2485,7 +2485,7 @@ const deserializeAws_restJson1UpdateQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8681,6 +8681,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-medialive/src/protocols/Aws_restJson1.ts b/clients/client-medialive/src/protocols/Aws_restJson1.ts index 8b07f8c7c9d1..df8b510c51e6 100644 --- a/clients/client-medialive/src/protocols/Aws_restJson1.ts +++ b/clients/client-medialive/src/protocols/Aws_restJson1.ts @@ -2064,7 +2064,7 @@ const deserializeAws_restJson1AcceptInputDeviceTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2132,7 +2132,7 @@ const deserializeAws_restJson1BatchDeleteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2197,7 +2197,7 @@ const deserializeAws_restJson1BatchStartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2262,7 +2262,7 @@ const deserializeAws_restJson1BatchStopCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2327,7 +2327,7 @@ const deserializeAws_restJson1BatchUpdateScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2386,7 +2386,7 @@ const deserializeAws_restJson1CancelInputDeviceTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2448,7 +2448,7 @@ const deserializeAws_restJson1ClaimDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2510,7 +2510,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2572,7 +2572,7 @@ const deserializeAws_restJson1CreateInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2628,7 +2628,7 @@ const deserializeAws_restJson1CreateInputSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2684,7 +2684,7 @@ const deserializeAws_restJson1CreateMultiplexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2746,7 +2746,7 @@ const deserializeAws_restJson1CreateMultiplexProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2808,7 +2808,7 @@ const deserializeAws_restJson1CreatePartnerInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2861,7 +2861,7 @@ const deserializeAws_restJson1CreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2962,7 +2962,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_restJson1DeleteInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3080,7 +3080,7 @@ const deserializeAws_restJson1DeleteInputSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3166,7 +3166,7 @@ const deserializeAws_restJson1DeleteMultiplexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3249,7 +3249,7 @@ const deserializeAws_restJson1DeleteMultiplexProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3368,7 +3368,7 @@ const deserializeAws_restJson1DeleteReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3427,7 +3427,7 @@ const deserializeAws_restJson1DeleteScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3483,7 +3483,7 @@ const deserializeAws_restJson1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3584,7 +3584,7 @@ const deserializeAws_restJson1DescribeChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3688,7 +3688,7 @@ const deserializeAws_restJson1DescribeInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3780,7 +3780,7 @@ const deserializeAws_restJson1DescribeInputDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3847,7 +3847,7 @@ const deserializeAws_restJson1DescribeInputDeviceThumbnailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3921,7 +3921,7 @@ const deserializeAws_restJson1DescribeInputSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4007,7 +4007,7 @@ const deserializeAws_restJson1DescribeMultiplexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4087,7 +4087,7 @@ const deserializeAws_restJson1DescribeMultiplexProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4179,7 +4179,7 @@ const deserializeAws_restJson1DescribeOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4295,7 +4295,7 @@ const deserializeAws_restJson1DescribeReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4357,7 +4357,7 @@ const deserializeAws_restJson1DescribeScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4419,7 +4419,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4478,7 +4478,7 @@ const deserializeAws_restJson1ListInputDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4540,7 +4540,7 @@ const deserializeAws_restJson1ListInputDeviceTransfersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4602,7 +4602,7 @@ const deserializeAws_restJson1ListInputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4664,7 +4664,7 @@ const deserializeAws_restJson1ListInputSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4723,7 +4723,7 @@ const deserializeAws_restJson1ListMultiplexesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4785,7 +4785,7 @@ const deserializeAws_restJson1ListMultiplexProgramsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4847,7 +4847,7 @@ const deserializeAws_restJson1ListOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4906,7 +4906,7 @@ const deserializeAws_restJson1ListReservationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4962,7 +4962,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5012,7 +5012,7 @@ const deserializeAws_restJson1PurchaseOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5071,7 +5071,7 @@ const deserializeAws_restJson1RebootInputDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5130,7 +5130,7 @@ const deserializeAws_restJson1RejectInputDeviceTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5246,7 +5246,7 @@ const deserializeAws_restJson1StartChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5305,7 +5305,7 @@ const deserializeAws_restJson1StartInputDeviceMaintenanceWindowCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5394,7 +5394,7 @@ const deserializeAws_restJson1StartMultiplexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5507,7 +5507,7 @@ const deserializeAws_restJson1StopChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5596,7 +5596,7 @@ const deserializeAws_restJson1StopMultiplexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5655,7 +5655,7 @@ const deserializeAws_restJson1TransferInputDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5720,7 +5720,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5779,7 +5779,7 @@ const deserializeAws_restJson1UpdateChannelClassCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5844,7 +5844,7 @@ const deserializeAws_restJson1UpdateInputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5936,7 +5936,7 @@ const deserializeAws_restJson1UpdateInputDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5998,7 +5998,7 @@ const deserializeAws_restJson1UpdateInputSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6057,7 +6057,7 @@ const deserializeAws_restJson1UpdateMultiplexCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6119,7 +6119,7 @@ const deserializeAws_restJson1UpdateMultiplexProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6181,7 +6181,7 @@ const deserializeAws_restJson1UpdateReservationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12737,6 +12737,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts index 4dfb291109b9..d38cae34fdc0 100644 --- a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts @@ -545,7 +545,7 @@ const deserializeAws_restJson1ConfigureLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -625,7 +625,7 @@ const deserializeAws_restJson1CreateAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -702,7 +702,7 @@ const deserializeAws_restJson1CreatePackagingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -773,7 +773,7 @@ const deserializeAws_restJson1CreatePackagingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -826,7 +826,7 @@ const deserializeAws_restJson1DeleteAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -879,7 +879,7 @@ const deserializeAws_restJson1DeletePackagingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -932,7 +932,7 @@ const deserializeAws_restJson1DeletePackagingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1012,7 +1012,7 @@ const deserializeAws_restJson1DescribeAssetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1089,7 +1089,7 @@ const deserializeAws_restJson1DescribePackagingConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1160,7 +1160,7 @@ const deserializeAws_restJson1DescribePackagingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1219,7 +1219,7 @@ const deserializeAws_restJson1ListAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1281,7 +1281,7 @@ const deserializeAws_restJson1ListPackagingConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1340,7 +1340,7 @@ const deserializeAws_restJson1ListPackagingGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1396,7 +1396,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1428,7 +1428,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1460,7 +1460,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1510,7 +1510,7 @@ const deserializeAws_restJson1UpdatePackagingGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2254,6 +2254,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts index 446131144c93..63bce8a236d1 100644 --- a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts @@ -624,7 +624,7 @@ const deserializeAws_restJson1ConfigureLogsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -698,7 +698,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -778,7 +778,7 @@ const deserializeAws_restJson1CreateHarvestJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -879,7 +879,7 @@ const deserializeAws_restJson1CreateOriginEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -932,7 +932,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -985,7 +985,7 @@ const deserializeAws_restJson1DeleteOriginEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_restJson1DescribeChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1139,7 +1139,7 @@ const deserializeAws_restJson1DescribeHarvestJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1240,7 +1240,7 @@ const deserializeAws_restJson1DescribeOriginEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1299,7 +1299,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1358,7 +1358,7 @@ const deserializeAws_restJson1ListHarvestJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1417,7 +1417,7 @@ const deserializeAws_restJson1ListOriginEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1473,7 +1473,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1526,7 +1526,7 @@ const deserializeAws_restJson1RotateChannelCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1600,7 +1600,7 @@ const deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1653,7 +1653,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1685,7 +1685,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1738,7 +1738,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1839,7 +1839,7 @@ const deserializeAws_restJson1UpdateOriginEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2662,6 +2662,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts index a35dbe3ade9b..f5cef93cb311 100644 --- a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts @@ -171,7 +171,7 @@ const deserializeAws_restJson1DeleteObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -226,7 +226,7 @@ const deserializeAws_restJson1DescribeObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -286,7 +286,7 @@ const deserializeAws_restJson1GetObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -339,7 +339,7 @@ const deserializeAws_restJson1ListItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -389,7 +389,7 @@ const deserializeAws_restJson1PutObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -535,6 +535,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediastore/src/protocols/Aws_json1_1.ts b/clients/client-mediastore/src/protocols/Aws_json1_1.ts index 97bef8d49f37..286b7291219f 100644 --- a/clients/client-mediastore/src/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/src/protocols/Aws_json1_1.ts @@ -401,7 +401,7 @@ const deserializeAws_json1_1CreateContainerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -448,7 +448,7 @@ const deserializeAws_json1_1DeleteContainerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -495,7 +495,7 @@ const deserializeAws_json1_1DeleteContainerPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -545,7 +545,7 @@ const deserializeAws_json1_1DeleteCorsPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -595,7 +595,7 @@ const deserializeAws_json1_1DeleteLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -645,7 +645,7 @@ const deserializeAws_json1_1DeleteMetricPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -695,7 +695,7 @@ const deserializeAws_json1_1DescribeContainerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -739,7 +739,7 @@ const deserializeAws_json1_1GetContainerPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -789,7 +789,7 @@ const deserializeAws_json1_1GetCorsPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -839,7 +839,7 @@ const deserializeAws_json1_1GetLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -889,7 +889,7 @@ const deserializeAws_json1_1GetMetricPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -939,7 +939,7 @@ const deserializeAws_json1_1ListContainersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -980,7 +980,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1027,7 +1027,7 @@ const deserializeAws_json1_1PutContainerPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1074,7 +1074,7 @@ const deserializeAws_json1_1PutCorsPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1121,7 +1121,7 @@ const deserializeAws_json1_1PutLifecyclePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1168,7 +1168,7 @@ const deserializeAws_json1_1PutMetricPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1215,7 +1215,7 @@ const deserializeAws_json1_1StartAccessLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1262,7 +1262,7 @@ const deserializeAws_json1_1StopAccessLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1309,7 +1309,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1356,7 +1356,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2089,6 +2089,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts index e3208876d6a3..f4befff4c9bb 100644 --- a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts @@ -1475,7 +1475,7 @@ const deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1537,7 +1537,7 @@ const deserializeAws_restJson1CreateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1593,7 +1593,7 @@ const deserializeAws_restJson1CreateLiveSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1643,7 +1643,7 @@ const deserializeAws_restJson1CreatePrefetchScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1702,7 +1702,7 @@ const deserializeAws_restJson1CreateProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1767,7 +1767,7 @@ const deserializeAws_restJson1CreateSourceLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1823,7 +1823,7 @@ const deserializeAws_restJson1CreateVodSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1855,7 +1855,7 @@ const deserializeAws_restJson1DeleteChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1887,7 +1887,7 @@ const deserializeAws_restJson1DeleteChannelPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1919,7 +1919,7 @@ const deserializeAws_restJson1DeleteLiveSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1951,7 +1951,7 @@ const deserializeAws_restJson1DeletePlaybackConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1983,7 +1983,7 @@ const deserializeAws_restJson1DeletePrefetchScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2015,7 +2015,7 @@ const deserializeAws_restJson1DeleteProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2047,7 +2047,7 @@ const deserializeAws_restJson1DeleteSourceLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2079,7 +2079,7 @@ const deserializeAws_restJson1DeleteVodSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2141,7 +2141,7 @@ const deserializeAws_restJson1DescribeChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2197,7 +2197,7 @@ const deserializeAws_restJson1DescribeLiveSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2256,7 +2256,7 @@ const deserializeAws_restJson1DescribeProgramCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2321,7 +2321,7 @@ const deserializeAws_restJson1DescribeSourceLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2377,7 +2377,7 @@ const deserializeAws_restJson1DescribeVodSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2412,7 +2412,7 @@ const deserializeAws_restJson1GetChannelPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2450,7 +2450,7 @@ const deserializeAws_restJson1GetChannelScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2548,7 +2548,7 @@ const deserializeAws_restJson1GetPlaybackConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2598,7 +2598,7 @@ const deserializeAws_restJson1GetPrefetchScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2636,7 +2636,7 @@ const deserializeAws_restJson1ListAlertsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2674,7 +2674,7 @@ const deserializeAws_restJson1ListChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2712,7 +2712,7 @@ const deserializeAws_restJson1ListLiveSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2750,7 +2750,7 @@ const deserializeAws_restJson1ListPlaybackConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2788,7 +2788,7 @@ const deserializeAws_restJson1ListPrefetchSchedulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2826,7 +2826,7 @@ const deserializeAws_restJson1ListSourceLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2861,7 +2861,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2905,7 +2905,7 @@ const deserializeAws_restJson1ListVodSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2937,7 +2937,7 @@ const deserializeAws_restJson1PutChannelPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3035,7 +3035,7 @@ const deserializeAws_restJson1PutPlaybackConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3067,7 +3067,7 @@ const deserializeAws_restJson1StartChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3099,7 +3099,7 @@ const deserializeAws_restJson1StopChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3131,7 +3131,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3169,7 +3169,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3237,7 +3237,7 @@ const deserializeAws_restJson1UpdateChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3293,7 +3293,7 @@ const deserializeAws_restJson1UpdateLiveSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3358,7 +3358,7 @@ const deserializeAws_restJson1UpdateSourceLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3414,7 +3414,7 @@ const deserializeAws_restJson1UpdateVodSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4419,6 +4419,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-memorydb/src/protocols/Aws_json1_1.ts b/clients/client-memorydb/src/protocols/Aws_json1_1.ts index 6c8d960a40fb..5474c7f22ae0 100644 --- a/clients/client-memorydb/src/protocols/Aws_json1_1.ts +++ b/clients/client-memorydb/src/protocols/Aws_json1_1.ts @@ -716,7 +716,7 @@ const deserializeAws_json1_1BatchUpdateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -760,7 +760,7 @@ const deserializeAws_json1_1CopySnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -822,7 +822,7 @@ const deserializeAws_json1_1CreateACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -881,7 +881,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -967,7 +967,7 @@ const deserializeAws_json1_1CreateParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1026,7 +1026,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1088,7 +1088,7 @@ const deserializeAws_json1_1CreateSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1147,7 +1147,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1203,7 +1203,7 @@ const deserializeAws_json1_1DeleteACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1250,7 +1250,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1306,7 +1306,7 @@ const deserializeAws_json1_1DeleteParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1359,7 +1359,7 @@ const deserializeAws_json1_1DeleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1412,7 +1412,7 @@ const deserializeAws_json1_1DeleteSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1459,7 +1459,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1506,7 +1506,7 @@ const deserializeAws_json1_1DescribeACLsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1550,7 +1550,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1600,7 +1600,7 @@ const deserializeAws_json1_1DescribeEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1647,7 +1647,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1694,7 +1694,7 @@ const deserializeAws_json1_1DescribeParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1744,7 +1744,7 @@ const deserializeAws_json1_1DescribeParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1794,7 +1794,7 @@ const deserializeAws_json1_1DescribeServiceUpdatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1838,7 +1838,7 @@ const deserializeAws_json1_1DescribeSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1888,7 +1888,7 @@ const deserializeAws_json1_1DescribeSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1932,7 +1932,7 @@ const deserializeAws_json1_1DescribeUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1976,7 +1976,7 @@ const deserializeAws_json1_1FailoverShardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2038,7 +2038,7 @@ const deserializeAws_json1_1ListAllowedNodeTypeUpdatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2088,7 +2088,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2153,7 +2153,7 @@ const deserializeAws_json1_1ResetParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2206,7 +2206,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2274,7 +2274,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2342,7 +2342,7 @@ const deserializeAws_json1_1UpdateACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2401,7 +2401,7 @@ const deserializeAws_json1_1UpdateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2487,7 +2487,7 @@ const deserializeAws_json1_1UpdateParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2540,7 +2540,7 @@ const deserializeAws_json1_1UpdateSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2596,7 +2596,7 @@ const deserializeAws_json1_1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5111,6 +5111,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mgn/src/protocols/Aws_restJson1.ts b/clients/client-mgn/src/protocols/Aws_restJson1.ts index 4756e9e4744b..9a780f192b9d 100644 --- a/clients/client-mgn/src/protocols/Aws_restJson1.ts +++ b/clients/client-mgn/src/protocols/Aws_restJson1.ts @@ -1178,7 +1178,7 @@ const deserializeAws_restJson1ChangeServerLifeCycleStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1237,7 +1237,7 @@ const deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1329,7 +1329,7 @@ const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1373,7 +1373,7 @@ const deserializeAws_restJson1DeleteJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1417,7 +1417,7 @@ const deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1461,7 +1461,7 @@ const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1505,7 +1505,7 @@ const deserializeAws_restJson1DeleteSourceServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1549,7 +1549,7 @@ const deserializeAws_restJson1DeleteVcenterClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1599,7 +1599,7 @@ const deserializeAws_restJson1DescribeJobLogItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1646,7 +1646,7 @@ const deserializeAws_restJson1DescribeJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1693,7 +1693,7 @@ const deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1743,7 +1743,7 @@ const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_restJson1DescribeSourceServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1DescribeVcenterClientsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1914,7 +1914,7 @@ const deserializeAws_restJson1DisconnectFromServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1988,7 +1988,7 @@ const deserializeAws_restJson1FinalizeCutoverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2065,7 +2065,7 @@ const deserializeAws_restJson1GetLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2157,7 +2157,7 @@ const deserializeAws_restJson1GetReplicationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2198,7 +2198,7 @@ const deserializeAws_restJson1InitializeServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2242,7 +2242,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2322,7 +2322,7 @@ const deserializeAws_restJson1MarkAsArchivedCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2396,7 +2396,7 @@ const deserializeAws_restJson1RetryDataReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2443,7 +2443,7 @@ const deserializeAws_restJson1StartCutoverCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2517,7 +2517,7 @@ const deserializeAws_restJson1StartReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2570,7 +2570,7 @@ const deserializeAws_restJson1StartTestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2614,7 +2614,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2667,7 +2667,7 @@ const deserializeAws_restJson1TerminateTargetInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2711,7 +2711,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2791,7 +2791,7 @@ const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2850,7 +2850,7 @@ const deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2948,7 +2948,7 @@ const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3046,7 +3046,7 @@ const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3123,7 +3123,7 @@ const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4371,6 +4371,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts index d8167bf98f45..c3112ad58154 100644 --- a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts +++ b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts @@ -988,7 +988,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1074,7 +1074,7 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1166,7 +1166,7 @@ const deserializeAws_restJson1CreateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1270,7 +1270,7 @@ const deserializeAws_restJson1CreateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1344,7 +1344,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1412,7 +1412,7 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1465,7 +1465,7 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1533,7 +1533,7 @@ const deserializeAws_restJson1DeleteRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1607,7 +1607,7 @@ const deserializeAws_restJson1DeleteServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1702,7 +1702,7 @@ const deserializeAws_restJson1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1788,7 +1788,7 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1841,7 +1841,7 @@ const deserializeAws_restJson1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1942,7 +1942,7 @@ const deserializeAws_restJson1GetRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2043,7 +2043,7 @@ const deserializeAws_restJson1GetServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2102,7 +2102,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2167,7 +2167,7 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2223,7 +2223,7 @@ const deserializeAws_restJson1ListEnvironmentVpcsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2279,7 +2279,7 @@ const deserializeAws_restJson1ListRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2341,7 +2341,7 @@ const deserializeAws_restJson1ListServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2400,7 +2400,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2444,7 +2444,7 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2497,7 +2497,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2541,7 +2541,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2603,7 +2603,7 @@ const deserializeAws_restJson1UpdateRouteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3234,6 +3234,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts index 64fa5cd5c0c7..c960fc792e8a 100644 --- a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts @@ -381,7 +381,7 @@ const deserializeAws_json1_1AssociateCreatedArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -446,7 +446,7 @@ const deserializeAws_json1_1AssociateDiscoveredResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -514,7 +514,7 @@ const deserializeAws_json1_1CreateProgressUpdateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -576,7 +576,7 @@ const deserializeAws_json1_1DeleteProgressUpdateStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -641,7 +641,7 @@ const deserializeAws_json1_1DescribeApplicationStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -703,7 +703,7 @@ const deserializeAws_json1_1DescribeMigrationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -762,7 +762,7 @@ const deserializeAws_json1_1DisassociateCreatedArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -827,7 +827,7 @@ const deserializeAws_json1_1DisassociateDiscoveredResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -892,7 +892,7 @@ const deserializeAws_json1_1ImportMigrationTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -957,7 +957,7 @@ const deserializeAws_json1_1ListApplicationStatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1013,7 +1013,7 @@ const deserializeAws_json1_1ListCreatedArtifactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1072,7 +1072,7 @@ const deserializeAws_json1_1ListDiscoveredResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1131,7 +1131,7 @@ const deserializeAws_json1_1ListMigrationTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1193,7 +1193,7 @@ const deserializeAws_json1_1ListProgressUpdateStreamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1249,7 +1249,7 @@ const deserializeAws_json1_1NotifyApplicationStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1317,7 +1317,7 @@ const deserializeAws_json1_1NotifyMigrationTaskStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1382,7 +1382,7 @@ const deserializeAws_json1_1PutResourceAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2239,6 +2239,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts index 38bfebe39172..2d7243d48ae4 100644 --- a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts @@ -105,7 +105,7 @@ const deserializeAws_json1_1CreateHomeRegionControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -161,7 +161,7 @@ const deserializeAws_json1_1DescribeHomeRegionControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -214,7 +214,7 @@ const deserializeAws_json1_1GetHomeRegionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -511,6 +511,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts index 42aaa2a4398a..dcecdfe6ab68 100644 --- a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts @@ -686,7 +686,7 @@ const deserializeAws_restJson1GetApplicationComponentDetailsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -736,7 +736,7 @@ const deserializeAws_restJson1GetApplicationComponentStrategiesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -786,7 +786,7 @@ const deserializeAws_restJson1GetAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -866,7 +866,7 @@ const deserializeAws_restJson1GetImportFileTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -931,7 +931,7 @@ const deserializeAws_restJson1GetPortfolioPreferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -981,7 +981,7 @@ const deserializeAws_restJson1GetPortfolioSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1034,7 +1034,7 @@ const deserializeAws_restJson1GetRecommendationReportDetailsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1096,7 +1096,7 @@ const deserializeAws_restJson1GetServerDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1149,7 +1149,7 @@ const deserializeAws_restJson1GetServerStrategiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1208,7 +1208,7 @@ const deserializeAws_restJson1ListApplicationComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1261,7 +1261,7 @@ const deserializeAws_restJson1ListCollectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1314,7 +1314,7 @@ const deserializeAws_restJson1ListImportFileTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1367,7 +1367,7 @@ const deserializeAws_restJson1ListServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1414,7 +1414,7 @@ const deserializeAws_restJson1PutPortfolioPreferencesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1467,7 +1467,7 @@ const deserializeAws_restJson1StartAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1517,7 +1517,7 @@ const deserializeAws_restJson1StartImportFileTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1570,7 +1570,7 @@ const deserializeAws_restJson1StartRecommendationReportGenerationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1620,7 +1620,7 @@ const deserializeAws_restJson1StopAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1667,7 +1667,7 @@ const deserializeAws_restJson1UpdateApplicationComponentConfigCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1714,7 +1714,7 @@ const deserializeAws_restJson1UpdateServerConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2890,6 +2890,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mobile/src/protocols/Aws_restJson1.ts b/clients/client-mobile/src/protocols/Aws_restJson1.ts index 5015120c9f78..650dc60a2fc3 100644 --- a/clients/client-mobile/src/protocols/Aws_restJson1.ts +++ b/clients/client-mobile/src/protocols/Aws_restJson1.ts @@ -282,7 +282,7 @@ const deserializeAws_restJson1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -344,7 +344,7 @@ const deserializeAws_restJson1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -397,7 +397,7 @@ const deserializeAws_restJson1DescribeBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -453,7 +453,7 @@ const deserializeAws_restJson1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -509,7 +509,7 @@ const deserializeAws_restJson1ExportBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -571,7 +571,7 @@ const deserializeAws_restJson1ExportProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -630,7 +630,7 @@ const deserializeAws_restJson1ListBundlesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -686,7 +686,7 @@ const deserializeAws_restJson1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -739,7 +739,7 @@ const deserializeAws_restJson1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1057,6 +1057,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mq/src/protocols/Aws_restJson1.ts b/clients/client-mq/src/protocols/Aws_restJson1.ts index eb123c2a4b83..2f9ea6559ac1 100644 --- a/clients/client-mq/src/protocols/Aws_restJson1.ts +++ b/clients/client-mq/src/protocols/Aws_restJson1.ts @@ -736,7 +736,7 @@ const deserializeAws_restJson1CreateBrokerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -804,7 +804,7 @@ const deserializeAws_restJson1CreateConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -851,7 +851,7 @@ const deserializeAws_restJson1CreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -898,7 +898,7 @@ const deserializeAws_restJson1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -951,7 +951,7 @@ const deserializeAws_restJson1DeleteBrokerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -998,7 +998,7 @@ const deserializeAws_restJson1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1045,7 +1045,7 @@ const deserializeAws_restJson1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1185,7 +1185,7 @@ const deserializeAws_restJson1DescribeBrokerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1241,7 +1241,7 @@ const deserializeAws_restJson1DescribeBrokerEngineTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1297,7 +1297,7 @@ const deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1371,7 +1371,7 @@ const deserializeAws_restJson1DescribeConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1430,7 +1430,7 @@ const deserializeAws_restJson1DescribeConfigurationRevisionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1492,7 +1492,7 @@ const deserializeAws_restJson1DescribeUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1545,7 +1545,7 @@ const deserializeAws_restJson1ListBrokersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1601,7 +1601,7 @@ const deserializeAws_restJson1ListConfigurationRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1657,7 +1657,7 @@ const deserializeAws_restJson1ListConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1704,7 +1704,7 @@ const deserializeAws_restJson1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1763,7 +1763,7 @@ const deserializeAws_restJson1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1810,7 +1810,7 @@ const deserializeAws_restJson1RebootBrokerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1890,7 +1890,7 @@ const deserializeAws_restJson1UpdateBrokerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1958,7 +1958,7 @@ const deserializeAws_restJson1UpdateConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2008,7 +2008,7 @@ const deserializeAws_restJson1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2657,6 +2657,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mturk/src/protocols/Aws_json1_1.ts b/clients/client-mturk/src/protocols/Aws_json1_1.ts index 8fff1afc09fe..2ca701e6a786 100644 --- a/clients/client-mturk/src/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/src/protocols/Aws_json1_1.ts @@ -755,7 +755,7 @@ const deserializeAws_json1_1AcceptQualificationRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -799,7 +799,7 @@ const deserializeAws_json1_1ApproveAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -843,7 +843,7 @@ const deserializeAws_json1_1AssociateQualificationWithWorkerCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -887,7 +887,7 @@ const deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -931,7 +931,7 @@ const deserializeAws_json1_1CreateHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -975,7 +975,7 @@ const deserializeAws_json1_1CreateHITTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1019,7 +1019,7 @@ const deserializeAws_json1_1CreateHITWithHITTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1063,7 +1063,7 @@ const deserializeAws_json1_1CreateQualificationTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1107,7 +1107,7 @@ const deserializeAws_json1_1CreateWorkerBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1151,7 +1151,7 @@ const deserializeAws_json1_1DeleteHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1195,7 +1195,7 @@ const deserializeAws_json1_1DeleteQualificationTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1239,7 +1239,7 @@ const deserializeAws_json1_1DeleteWorkerBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1283,7 +1283,7 @@ const deserializeAws_json1_1DisassociateQualificationFromWorkerCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1327,7 +1327,7 @@ const deserializeAws_json1_1GetAccountBalanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1371,7 +1371,7 @@ const deserializeAws_json1_1GetAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1415,7 +1415,7 @@ const deserializeAws_json1_1GetFileUploadURLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1459,7 +1459,7 @@ const deserializeAws_json1_1GetHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1503,7 +1503,7 @@ const deserializeAws_json1_1GetQualificationScoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1547,7 +1547,7 @@ const deserializeAws_json1_1GetQualificationTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1591,7 +1591,7 @@ const deserializeAws_json1_1ListAssignmentsForHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1635,7 +1635,7 @@ const deserializeAws_json1_1ListBonusPaymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1679,7 +1679,7 @@ const deserializeAws_json1_1ListHITsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1723,7 +1723,7 @@ const deserializeAws_json1_1ListHITsForQualificationTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1767,7 +1767,7 @@ const deserializeAws_json1_1ListQualificationRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1811,7 +1811,7 @@ const deserializeAws_json1_1ListQualificationTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1855,7 +1855,7 @@ const deserializeAws_json1_1ListReviewableHITsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1899,7 +1899,7 @@ const deserializeAws_json1_1ListReviewPolicyResultsForHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1943,7 +1943,7 @@ const deserializeAws_json1_1ListWorkerBlocksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1ListWorkersWithQualificationTypeCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2031,7 +2031,7 @@ const deserializeAws_json1_1NotifyWorkersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2075,7 +2075,7 @@ const deserializeAws_json1_1RejectAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2119,7 +2119,7 @@ const deserializeAws_json1_1RejectQualificationRequestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2163,7 +2163,7 @@ const deserializeAws_json1_1SendBonusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2207,7 +2207,7 @@ const deserializeAws_json1_1SendTestEventNotificationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2251,7 +2251,7 @@ const deserializeAws_json1_1UpdateExpirationForHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2295,7 +2295,7 @@ const deserializeAws_json1_1UpdateHITReviewStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2339,7 +2339,7 @@ const deserializeAws_json1_1UpdateHITTypeOfHITCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2383,7 +2383,7 @@ const deserializeAws_json1_1UpdateNotificationSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2427,7 +2427,7 @@ const deserializeAws_json1_1UpdateQualificationTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3932,6 +3932,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-mwaa/src/protocols/Aws_restJson1.ts b/clients/client-mwaa/src/protocols/Aws_restJson1.ts index 4c0dbf6811f4..93f947457476 100644 --- a/clients/client-mwaa/src/protocols/Aws_restJson1.ts +++ b/clients/client-mwaa/src/protocols/Aws_restJson1.ts @@ -481,7 +481,7 @@ const deserializeAws_restJson1CreateCliTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -522,7 +522,7 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -569,7 +569,7 @@ const deserializeAws_restJson1CreateWebLoginTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -616,7 +616,7 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -663,7 +663,7 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -713,7 +713,7 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -757,7 +757,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -801,7 +801,7 @@ const deserializeAws_restJson1PublishMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -842,7 +842,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -886,7 +886,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -933,7 +933,7 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1364,6 +1364,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-neptune/src/protocols/Aws_query.ts b/clients/client-neptune/src/protocols/Aws_query.ts index 1b39feb1071e..1617afb3e524 100644 --- a/clients/client-neptune/src/protocols/Aws_query.ts +++ b/clients/client-neptune/src/protocols/Aws_query.ts @@ -1624,7 +1624,7 @@ const deserializeAws_queryAddRoleToDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1677,7 +1677,7 @@ const deserializeAws_queryAddSourceIdentifierToSubscriptionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1718,7 +1718,7 @@ const deserializeAws_queryAddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1765,7 +1765,7 @@ const deserializeAws_queryApplyPendingMaintenanceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1806,7 +1806,7 @@ const deserializeAws_queryCopyDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1853,7 +1853,7 @@ const deserializeAws_queryCopyDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1909,7 +1909,7 @@ const deserializeAws_queryCopyDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1956,7 +1956,7 @@ const deserializeAws_queryCreateDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2045,7 +2045,7 @@ const deserializeAws_queryCreateDBClusterEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2101,7 +2101,7 @@ const deserializeAws_queryCreateDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2145,7 +2145,7 @@ const deserializeAws_queryCreateDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2198,7 +2198,7 @@ const deserializeAws_queryCreateDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2290,7 +2290,7 @@ const deserializeAws_queryCreateDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2334,7 +2334,7 @@ const deserializeAws_queryCreateDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2387,7 +2387,7 @@ const deserializeAws_queryCreateEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2446,7 +2446,7 @@ const deserializeAws_queryCreateGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2496,7 +2496,7 @@ const deserializeAws_queryDeleteDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2549,7 +2549,7 @@ const deserializeAws_queryDeleteDBClusterEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2593,7 +2593,7 @@ const deserializeAws_queryDeleteDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2637,7 +2637,7 @@ const deserializeAws_queryDeleteDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2681,7 +2681,7 @@ const deserializeAws_queryDeleteDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2731,7 +2731,7 @@ const deserializeAws_queryDeleteDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2772,7 +2772,7 @@ const deserializeAws_queryDeleteDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2819,7 +2819,7 @@ const deserializeAws_queryDeleteEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2863,7 +2863,7 @@ const deserializeAws_queryDeleteGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2907,7 +2907,7 @@ const deserializeAws_queryDescribeDBClusterEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2948,7 +2948,7 @@ const deserializeAws_queryDescribeDBClusterParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2989,7 +2989,7 @@ const deserializeAws_queryDescribeDBClusterParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3030,7 +3030,7 @@ const deserializeAws_queryDescribeDBClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3074,7 +3074,7 @@ const deserializeAws_queryDescribeDBClusterSnapshotAttributesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3115,7 +3115,7 @@ const deserializeAws_queryDescribeDBClusterSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_queryDescribeDBEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3191,7 +3191,7 @@ const deserializeAws_queryDescribeDBInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3232,7 +3232,7 @@ const deserializeAws_queryDescribeDBParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3273,7 +3273,7 @@ const deserializeAws_queryDescribeDBParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3314,7 +3314,7 @@ const deserializeAws_queryDescribeDBSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3358,7 +3358,7 @@ const deserializeAws_queryDescribeEngineDefaultClusterParametersCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3396,7 +3396,7 @@ const deserializeAws_queryDescribeEngineDefaultParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3431,7 +3431,7 @@ const deserializeAws_queryDescribeEventCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3466,7 +3466,7 @@ const deserializeAws_queryDescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3501,7 +3501,7 @@ const deserializeAws_queryDescribeEventSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3542,7 +3542,7 @@ const deserializeAws_queryDescribeGlobalClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3586,7 +3586,7 @@ const deserializeAws_queryDescribeOrderableDBInstanceOptionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3624,7 +3624,7 @@ const deserializeAws_queryDescribePendingMaintenanceActionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3668,7 +3668,7 @@ const deserializeAws_queryDescribeValidDBInstanceModificationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3712,7 +3712,7 @@ const deserializeAws_queryFailoverDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3759,7 +3759,7 @@ const deserializeAws_queryFailoverGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3809,7 +3809,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3856,7 +3856,7 @@ const deserializeAws_queryModifyDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3927,7 +3927,7 @@ const deserializeAws_queryModifyDBClusterEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3980,7 +3980,7 @@ const deserializeAws_queryModifyDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4027,7 +4027,7 @@ const deserializeAws_queryModifyDBClusterSnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4074,7 +4074,7 @@ const deserializeAws_queryModifyDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4160,7 +4160,7 @@ const deserializeAws_queryModifyDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4204,7 +4204,7 @@ const deserializeAws_queryModifyDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4257,7 +4257,7 @@ const deserializeAws_queryModifyEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4313,7 +4313,7 @@ const deserializeAws_queryModifyGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4357,7 +4357,7 @@ const deserializeAws_queryPromoteReadReplicaDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4401,7 +4401,7 @@ const deserializeAws_queryRebootDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4445,7 +4445,7 @@ const deserializeAws_queryRemoveFromGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4489,7 +4489,7 @@ const deserializeAws_queryRemoveRoleFromDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4539,7 +4539,7 @@ const deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4580,7 +4580,7 @@ const deserializeAws_queryRemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4627,7 +4627,7 @@ const deserializeAws_queryResetDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4671,7 +4671,7 @@ const deserializeAws_queryResetDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4715,7 +4715,7 @@ const deserializeAws_queryRestoreDBClusterFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4801,7 +4801,7 @@ const deserializeAws_queryRestoreDBClusterToPointInTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4890,7 +4890,7 @@ const deserializeAws_queryStartDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4937,7 +4937,7 @@ const deserializeAws_queryStopDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12069,6 +12069,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts index 069c44c48dc5..3087f95453e8 100644 --- a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts +++ b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts @@ -655,7 +655,7 @@ const deserializeAws_json1_0AssociateFirewallPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -711,7 +711,7 @@ const deserializeAws_json1_0AssociateSubnetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -770,7 +770,7 @@ const deserializeAws_json1_0CreateFirewallCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -826,7 +826,7 @@ const deserializeAws_json1_0CreateFirewallPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -879,7 +879,7 @@ const deserializeAws_json1_0CreateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -932,7 +932,7 @@ const deserializeAws_json1_0DeleteFirewallCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -988,7 +988,7 @@ const deserializeAws_json1_0DeleteFirewallPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1044,7 +1044,7 @@ const deserializeAws_json1_0DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1097,7 +1097,7 @@ const deserializeAws_json1_0DeleteRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1153,7 +1153,7 @@ const deserializeAws_json1_0DescribeFirewallCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1203,7 +1203,7 @@ const deserializeAws_json1_0DescribeFirewallPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1253,7 +1253,7 @@ const deserializeAws_json1_0DescribeLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1303,7 +1303,7 @@ const deserializeAws_json1_0DescribeResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1353,7 +1353,7 @@ const deserializeAws_json1_0DescribeRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1403,7 +1403,7 @@ const deserializeAws_json1_0DescribeRuleGroupMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1453,7 +1453,7 @@ const deserializeAws_json1_0DisassociateSubnetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1509,7 +1509,7 @@ const deserializeAws_json1_0ListFirewallPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1556,7 +1556,7 @@ const deserializeAws_json1_0ListFirewallsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1603,7 +1603,7 @@ const deserializeAws_json1_0ListRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1650,7 +1650,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1700,7 +1700,7 @@ const deserializeAws_json1_0PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1753,7 +1753,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1803,7 +1803,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1853,7 +1853,7 @@ const deserializeAws_json1_0UpdateFirewallDeleteProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1909,7 +1909,7 @@ const deserializeAws_json1_0UpdateFirewallDescriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1962,7 +1962,7 @@ const deserializeAws_json1_0UpdateFirewallEncryptionConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2018,7 +2018,7 @@ const deserializeAws_json1_0UpdateFirewallPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2071,7 +2071,7 @@ const deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2127,7 +2127,7 @@ const deserializeAws_json1_0UpdateLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2183,7 +2183,7 @@ const deserializeAws_json1_0UpdateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2236,7 +2236,7 @@ const deserializeAws_json1_0UpdateSubnetChangeProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4709,6 +4709,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts index dc5533d4c0e3..a733cb40672a 100644 --- a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts @@ -3134,7 +3134,7 @@ const deserializeAws_restJson1AcceptAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3193,7 +3193,7 @@ const deserializeAws_restJson1AssociateConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3255,7 +3255,7 @@ const deserializeAws_restJson1AssociateCustomerGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3314,7 +3314,7 @@ const deserializeAws_restJson1AssociateLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3376,7 +3376,7 @@ const deserializeAws_restJson1AssociateTransitGatewayConnectPeerCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3435,7 +3435,7 @@ const deserializeAws_restJson1CreateConnectAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3491,7 +3491,7 @@ const deserializeAws_restJson1CreateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3547,7 +3547,7 @@ const deserializeAws_restJson1CreateConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3603,7 +3603,7 @@ const deserializeAws_restJson1CreateCoreNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3662,7 +3662,7 @@ const deserializeAws_restJson1CreateDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3721,7 +3721,7 @@ const deserializeAws_restJson1CreateGlobalNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3777,7 +3777,7 @@ const deserializeAws_restJson1CreateLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3836,7 +3836,7 @@ const deserializeAws_restJson1CreateSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3898,7 +3898,7 @@ const deserializeAws_restJson1CreateSiteToSiteVpnAttachmentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3954,7 +3954,7 @@ const deserializeAws_restJson1CreateTransitGatewayPeeringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4013,7 +4013,7 @@ const deserializeAws_restJson1CreateTransitGatewayRouteTableAttachmentCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4069,7 +4069,7 @@ const deserializeAws_restJson1CreateVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4125,7 +4125,7 @@ const deserializeAws_restJson1DeleteAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4181,7 +4181,7 @@ const deserializeAws_restJson1DeleteConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4237,7 +4237,7 @@ const deserializeAws_restJson1DeleteConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4293,7 +4293,7 @@ const deserializeAws_restJson1DeleteCoreNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4349,7 +4349,7 @@ const deserializeAws_restJson1DeleteCoreNetworkPolicyVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4405,7 +4405,7 @@ const deserializeAws_restJson1DeleteDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4461,7 +4461,7 @@ const deserializeAws_restJson1DeleteGlobalNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4517,7 +4517,7 @@ const deserializeAws_restJson1DeleteLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4573,7 +4573,7 @@ const deserializeAws_restJson1DeletePeeringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4626,7 +4626,7 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4679,7 +4679,7 @@ const deserializeAws_restJson1DeleteSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4738,7 +4738,7 @@ const deserializeAws_restJson1DeregisterTransitGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4797,7 +4797,7 @@ const deserializeAws_restJson1DescribeGlobalNetworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4853,7 +4853,7 @@ const deserializeAws_restJson1DisassociateConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4912,7 +4912,7 @@ const deserializeAws_restJson1DisassociateCustomerGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4968,7 +4968,7 @@ const deserializeAws_restJson1DisassociateLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5027,7 +5027,7 @@ const deserializeAws_restJson1DisassociateTransitGatewayConnectPeerCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5080,7 +5080,7 @@ const deserializeAws_restJson1ExecuteCoreNetworkChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5136,7 +5136,7 @@ const deserializeAws_restJson1GetConnectAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5192,7 +5192,7 @@ const deserializeAws_restJson1GetConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5245,7 +5245,7 @@ const deserializeAws_restJson1GetConnectPeerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5304,7 +5304,7 @@ const deserializeAws_restJson1GetConnectPeerAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5360,7 +5360,7 @@ const deserializeAws_restJson1GetCoreNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5419,7 +5419,7 @@ const deserializeAws_restJson1GetCoreNetworkChangeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5475,7 +5475,7 @@ const deserializeAws_restJson1GetCoreNetworkChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5528,7 +5528,7 @@ const deserializeAws_restJson1GetCoreNetworkPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5587,7 +5587,7 @@ const deserializeAws_restJson1GetCustomerGatewayAssociationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5646,7 +5646,7 @@ const deserializeAws_restJson1GetDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5702,7 +5702,7 @@ const deserializeAws_restJson1GetLinkAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5758,7 +5758,7 @@ const deserializeAws_restJson1GetLinksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5817,7 +5817,7 @@ const deserializeAws_restJson1GetNetworkResourceCountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5870,7 +5870,7 @@ const deserializeAws_restJson1GetNetworkResourceRelationshipsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5926,7 +5926,7 @@ const deserializeAws_restJson1GetNetworkResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5994,7 +5994,7 @@ const deserializeAws_restJson1GetNetworkRoutesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6050,7 +6050,7 @@ const deserializeAws_restJson1GetNetworkTelemetryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6103,7 +6103,7 @@ const deserializeAws_restJson1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6153,7 +6153,7 @@ const deserializeAws_restJson1GetRouteAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6209,7 +6209,7 @@ const deserializeAws_restJson1GetSitesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6265,7 +6265,7 @@ const deserializeAws_restJson1GetSiteToSiteVpnAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6324,7 +6324,7 @@ const deserializeAws_restJson1GetTransitGatewayConnectPeerAssociationsCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6380,7 +6380,7 @@ const deserializeAws_restJson1GetTransitGatewayPeeringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6439,7 +6439,7 @@ const deserializeAws_restJson1GetTransitGatewayRegistrationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6495,7 +6495,7 @@ const deserializeAws_restJson1GetTransitGatewayRouteTableAttachmentCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6548,7 +6548,7 @@ const deserializeAws_restJson1GetVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6604,7 +6604,7 @@ const deserializeAws_restJson1ListAttachmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6657,7 +6657,7 @@ const deserializeAws_restJson1ListConnectPeersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6713,7 +6713,7 @@ const deserializeAws_restJson1ListCoreNetworkPolicyVersionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6769,7 +6769,7 @@ const deserializeAws_restJson1ListCoreNetworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6822,7 +6822,7 @@ const deserializeAws_restJson1ListOrganizationServiceAccessStatusCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6860,7 +6860,7 @@ const deserializeAws_restJson1ListPeeringsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6910,7 +6910,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6963,7 +6963,7 @@ const deserializeAws_restJson1PutCoreNetworkPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7019,7 +7019,7 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7078,7 +7078,7 @@ const deserializeAws_restJson1RegisterTransitGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7134,7 +7134,7 @@ const deserializeAws_restJson1RejectAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7190,7 +7190,7 @@ const deserializeAws_restJson1RestoreCoreNetworkPolicyVersionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7246,7 +7246,7 @@ const deserializeAws_restJson1StartOrganizationServiceAccessUpdateCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7302,7 +7302,7 @@ const deserializeAws_restJson1StartRouteAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7355,7 +7355,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7411,7 +7411,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7467,7 +7467,7 @@ const deserializeAws_restJson1UpdateConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7523,7 +7523,7 @@ const deserializeAws_restJson1UpdateCoreNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7579,7 +7579,7 @@ const deserializeAws_restJson1UpdateDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7635,7 +7635,7 @@ const deserializeAws_restJson1UpdateGlobalNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7691,7 +7691,7 @@ const deserializeAws_restJson1UpdateLinkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7753,7 +7753,7 @@ const deserializeAws_restJson1UpdateNetworkResourceMetadataCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7809,7 +7809,7 @@ const deserializeAws_restJson1UpdateSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7865,7 +7865,7 @@ const deserializeAws_restJson1UpdateVpcAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9474,6 +9474,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-nimble/src/protocols/Aws_restJson1.ts b/clients/client-nimble/src/protocols/Aws_restJson1.ts index e09c2001bc48..b7fc965bb944 100644 --- a/clients/client-nimble/src/protocols/Aws_restJson1.ts +++ b/clients/client-nimble/src/protocols/Aws_restJson1.ts @@ -1651,7 +1651,7 @@ const deserializeAws_restJson1AcceptEulasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1710,7 +1710,7 @@ const deserializeAws_restJson1CreateLaunchProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1769,7 +1769,7 @@ const deserializeAws_restJson1CreateStreamingImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1828,7 +1828,7 @@ const deserializeAws_restJson1CreateStreamingSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1887,7 +1887,7 @@ const deserializeAws_restJson1CreateStreamingSessionStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1946,7 +1946,7 @@ const deserializeAws_restJson1CreateStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2005,7 +2005,7 @@ const deserializeAws_restJson1CreateStudioComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2064,7 +2064,7 @@ const deserializeAws_restJson1DeleteLaunchProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2120,7 +2120,7 @@ const deserializeAws_restJson1DeleteLaunchProfileMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2179,7 +2179,7 @@ const deserializeAws_restJson1DeleteStreamingImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2238,7 +2238,7 @@ const deserializeAws_restJson1DeleteStreamingSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2297,7 +2297,7 @@ const deserializeAws_restJson1DeleteStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2356,7 +2356,7 @@ const deserializeAws_restJson1DeleteStudioComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2412,7 +2412,7 @@ const deserializeAws_restJson1DeleteStudioMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2471,7 +2471,7 @@ const deserializeAws_restJson1GetEulaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2530,7 +2530,7 @@ const deserializeAws_restJson1GetLaunchProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2598,7 +2598,7 @@ const deserializeAws_restJson1GetLaunchProfileDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2660,7 +2660,7 @@ const deserializeAws_restJson1GetLaunchProfileInitializationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2719,7 +2719,7 @@ const deserializeAws_restJson1GetLaunchProfileMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2778,7 +2778,7 @@ const deserializeAws_restJson1GetStreamingImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2837,7 +2837,7 @@ const deserializeAws_restJson1GetStreamingSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2896,7 +2896,7 @@ const deserializeAws_restJson1GetStreamingSessionStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2955,7 +2955,7 @@ const deserializeAws_restJson1GetStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3014,7 +3014,7 @@ const deserializeAws_restJson1GetStudioComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3073,7 +3073,7 @@ const deserializeAws_restJson1GetStudioMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3135,7 +3135,7 @@ const deserializeAws_restJson1ListEulaAcceptancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3197,7 +3197,7 @@ const deserializeAws_restJson1ListEulasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3259,7 +3259,7 @@ const deserializeAws_restJson1ListLaunchProfileMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3321,7 +3321,7 @@ const deserializeAws_restJson1ListLaunchProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3383,7 +3383,7 @@ const deserializeAws_restJson1ListStreamingImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3445,7 +3445,7 @@ const deserializeAws_restJson1ListStreamingSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3507,7 +3507,7 @@ const deserializeAws_restJson1ListStudioComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3569,7 +3569,7 @@ const deserializeAws_restJson1ListStudioMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3631,7 +3631,7 @@ const deserializeAws_restJson1ListStudiosCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3690,7 +3690,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3746,7 +3746,7 @@ const deserializeAws_restJson1PutLaunchProfileMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3802,7 +3802,7 @@ const deserializeAws_restJson1PutStudioMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3861,7 +3861,7 @@ const deserializeAws_restJson1StartStreamingSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3920,7 +3920,7 @@ const deserializeAws_restJson1StartStudioSSOConfigurationRepairCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3979,7 +3979,7 @@ const deserializeAws_restJson1StopStreamingSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4035,7 +4035,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4091,7 +4091,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4150,7 +4150,7 @@ const deserializeAws_restJson1UpdateLaunchProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4209,7 +4209,7 @@ const deserializeAws_restJson1UpdateLaunchProfileMemberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4268,7 +4268,7 @@ const deserializeAws_restJson1UpdateStreamingImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4327,7 +4327,7 @@ const deserializeAws_restJson1UpdateStudioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4386,7 +4386,7 @@ const deserializeAws_restJson1UpdateStudioComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5720,6 +5720,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-opensearch/src/protocols/Aws_restJson1.ts b/clients/client-opensearch/src/protocols/Aws_restJson1.ts index f9ba94f40be9..2d551b9680d8 100644 --- a/clients/client-opensearch/src/protocols/Aws_restJson1.ts +++ b/clients/client-opensearch/src/protocols/Aws_restJson1.ts @@ -1387,7 +1387,7 @@ const deserializeAws_restJson1AcceptInboundConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1431,7 +1431,7 @@ const deserializeAws_restJson1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1481,7 +1481,7 @@ const deserializeAws_restJson1AssociatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1540,7 +1540,7 @@ const deserializeAws_restJson1CancelServiceSoftwareUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1590,7 +1590,7 @@ const deserializeAws_restJson1CreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1661,7 +1661,7 @@ const deserializeAws_restJson1CreateOutboundConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1711,7 +1711,7 @@ const deserializeAws_restJson1CreatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1770,7 +1770,7 @@ const deserializeAws_restJson1DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1820,7 +1820,7 @@ const deserializeAws_restJson1DeleteInboundConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1864,7 +1864,7 @@ const deserializeAws_restJson1DeleteOutboundConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1908,7 +1908,7 @@ const deserializeAws_restJson1DeletePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1964,7 +1964,7 @@ const deserializeAws_restJson1DescribeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2017,7 +2017,7 @@ const deserializeAws_restJson1DescribeDomainAutoTunesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2070,7 +2070,7 @@ const deserializeAws_restJson1DescribeDomainChangeProgressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2120,7 +2120,7 @@ const deserializeAws_restJson1DescribeDomainConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2170,7 +2170,7 @@ const deserializeAws_restJson1DescribeDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2220,7 +2220,7 @@ const deserializeAws_restJson1DescribeInboundConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2264,7 +2264,7 @@ const deserializeAws_restJson1DescribeInstanceTypeLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2323,7 +2323,7 @@ const deserializeAws_restJson1DescribeOutboundConnectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2370,7 +2370,7 @@ const deserializeAws_restJson1DescribePackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1DescribeReservedInstanceOfferingsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2482,7 +2482,7 @@ const deserializeAws_restJson1DescribeReservedInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2532,7 +2532,7 @@ const deserializeAws_restJson1DissociatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2588,7 +2588,7 @@ const deserializeAws_restJson1GetCompatibleVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2650,7 +2650,7 @@ const deserializeAws_restJson1GetPackageVersionHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2706,7 +2706,7 @@ const deserializeAws_restJson1GetUpgradeHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2765,7 +2765,7 @@ const deserializeAws_restJson1GetUpgradeStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2818,7 +2818,7 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2868,7 +2868,7 @@ const deserializeAws_restJson1ListDomainsForPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2924,7 +2924,7 @@ const deserializeAws_restJson1ListInstanceTypeDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2980,7 +2980,7 @@ const deserializeAws_restJson1ListPackagesForDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3033,7 +3033,7 @@ const deserializeAws_restJson1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3086,7 +3086,7 @@ const deserializeAws_restJson1ListVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3139,7 +3139,7 @@ const deserializeAws_restJson1PurchaseReservedInstanceOfferingCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3195,7 +3195,7 @@ const deserializeAws_restJson1RejectInboundConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3236,7 +3236,7 @@ const deserializeAws_restJson1RemoveTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3286,7 +3286,7 @@ const deserializeAws_restJson1StartServiceSoftwareUpdateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3339,7 +3339,7 @@ const deserializeAws_restJson1UpdateDomainConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3395,7 +3395,7 @@ const deserializeAws_restJson1UpdatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3466,7 +3466,7 @@ const deserializeAws_restJson1UpgradeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5276,6 +5276,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-opsworks/src/protocols/Aws_json1_1.ts b/clients/client-opsworks/src/protocols/Aws_json1_1.ts index ac3cfe873419..c2a1700649d7 100644 --- a/clients/client-opsworks/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/src/protocols/Aws_json1_1.ts @@ -1308,7 +1308,7 @@ const deserializeAws_json1_1AssignInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1349,7 +1349,7 @@ const deserializeAws_json1_1AssignVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1390,7 +1390,7 @@ const deserializeAws_json1_1AssociateElasticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1431,7 +1431,7 @@ const deserializeAws_json1_1AttachElasticLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1475,7 +1475,7 @@ const deserializeAws_json1_1CloneStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1519,7 +1519,7 @@ const deserializeAws_json1_1CreateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1563,7 +1563,7 @@ const deserializeAws_json1_1CreateDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1607,7 +1607,7 @@ const deserializeAws_json1_1CreateInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1651,7 +1651,7 @@ const deserializeAws_json1_1CreateLayerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1695,7 +1695,7 @@ const deserializeAws_json1_1CreateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1736,7 +1736,7 @@ const deserializeAws_json1_1CreateUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1774,7 +1774,7 @@ const deserializeAws_json1_1DeleteAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1815,7 +1815,7 @@ const deserializeAws_json1_1DeleteInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1856,7 +1856,7 @@ const deserializeAws_json1_1DeleteLayerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1897,7 +1897,7 @@ const deserializeAws_json1_1DeleteStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1938,7 +1938,7 @@ const deserializeAws_json1_1DeleteUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1979,7 +1979,7 @@ const deserializeAws_json1_1DeregisterEcsClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2020,7 +2020,7 @@ const deserializeAws_json1_1DeregisterElasticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2061,7 +2061,7 @@ const deserializeAws_json1_1DeregisterInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2102,7 +2102,7 @@ const deserializeAws_json1_1DeregisterRdsDbInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2143,7 +2143,7 @@ const deserializeAws_json1_1DeregisterVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2187,7 +2187,7 @@ const deserializeAws_json1_1DescribeAgentVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2231,7 +2231,7 @@ const deserializeAws_json1_1DescribeAppsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_json1_1DescribeCommandsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2319,7 +2319,7 @@ const deserializeAws_json1_1DescribeDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2363,7 +2363,7 @@ const deserializeAws_json1_1DescribeEcsClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2407,7 +2407,7 @@ const deserializeAws_json1_1DescribeElasticIpsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2451,7 +2451,7 @@ const deserializeAws_json1_1DescribeElasticLoadBalancersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2495,7 +2495,7 @@ const deserializeAws_json1_1DescribeInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2539,7 +2539,7 @@ const deserializeAws_json1_1DescribeLayersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2583,7 +2583,7 @@ const deserializeAws_json1_1DescribeLoadBasedAutoScalingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2627,7 +2627,7 @@ const deserializeAws_json1_1DescribeMyUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2662,7 +2662,7 @@ const deserializeAws_json1_1DescribeOperatingSystemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2697,7 +2697,7 @@ const deserializeAws_json1_1DescribePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2741,7 +2741,7 @@ const deserializeAws_json1_1DescribeRaidArraysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2785,7 +2785,7 @@ const deserializeAws_json1_1DescribeRdsDbInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2829,7 +2829,7 @@ const deserializeAws_json1_1DescribeServiceErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2873,7 +2873,7 @@ const deserializeAws_json1_1DescribeStackProvisioningParametersCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2917,7 +2917,7 @@ const deserializeAws_json1_1DescribeStacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2961,7 +2961,7 @@ const deserializeAws_json1_1DescribeStackSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3005,7 +3005,7 @@ const deserializeAws_json1_1DescribeTimeBasedAutoScalingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3049,7 +3049,7 @@ const deserializeAws_json1_1DescribeUserProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3093,7 +3093,7 @@ const deserializeAws_json1_1DescribeVolumesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3134,7 +3134,7 @@ const deserializeAws_json1_1DetachElasticLoadBalancerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3172,7 +3172,7 @@ const deserializeAws_json1_1DisassociateElasticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3216,7 +3216,7 @@ const deserializeAws_json1_1GetHostnameSuggestionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3260,7 +3260,7 @@ const deserializeAws_json1_1GrantAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3304,7 +3304,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3345,7 +3345,7 @@ const deserializeAws_json1_1RebootInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3389,7 +3389,7 @@ const deserializeAws_json1_1RegisterEcsClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3433,7 +3433,7 @@ const deserializeAws_json1_1RegisterElasticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3477,7 +3477,7 @@ const deserializeAws_json1_1RegisterInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3518,7 +3518,7 @@ const deserializeAws_json1_1RegisterRdsDbInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3562,7 +3562,7 @@ const deserializeAws_json1_1RegisterVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3603,7 +3603,7 @@ const deserializeAws_json1_1SetLoadBasedAutoScalingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3644,7 +3644,7 @@ const deserializeAws_json1_1SetPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3685,7 +3685,7 @@ const deserializeAws_json1_1SetTimeBasedAutoScalingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3726,7 +3726,7 @@ const deserializeAws_json1_1StartInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3767,7 +3767,7 @@ const deserializeAws_json1_1StartStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3808,7 +3808,7 @@ const deserializeAws_json1_1StopInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3849,7 +3849,7 @@ const deserializeAws_json1_1StopStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3890,7 +3890,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3931,7 +3931,7 @@ const deserializeAws_json1_1UnassignInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3972,7 +3972,7 @@ const deserializeAws_json1_1UnassignVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4013,7 +4013,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4054,7 +4054,7 @@ const deserializeAws_json1_1UpdateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4095,7 +4095,7 @@ const deserializeAws_json1_1UpdateElasticIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4136,7 +4136,7 @@ const deserializeAws_json1_1UpdateInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4177,7 +4177,7 @@ const deserializeAws_json1_1UpdateLayerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4218,7 +4218,7 @@ const deserializeAws_json1_1UpdateMyUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4256,7 +4256,7 @@ const deserializeAws_json1_1UpdateRdsDbInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4297,7 +4297,7 @@ const deserializeAws_json1_1UpdateStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4338,7 +4338,7 @@ const deserializeAws_json1_1UpdateUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4379,7 +4379,7 @@ const deserializeAws_json1_1UpdateVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6969,6 +6969,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts index 99dd06c44bbf..b5674f80e025 100644 --- a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts @@ -375,7 +375,7 @@ const deserializeAws_json1_1AssociateNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -422,7 +422,7 @@ const deserializeAws_json1_1CreateBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -472,7 +472,7 @@ const deserializeAws_json1_1CreateServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -522,7 +522,7 @@ const deserializeAws_json1_1DeleteBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -569,7 +569,7 @@ const deserializeAws_json1_1DeleteServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -616,7 +616,7 @@ const deserializeAws_json1_1DescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -651,7 +651,7 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -698,7 +698,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -745,7 +745,7 @@ const deserializeAws_json1_1DescribeNodeAssociationStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -789,7 +789,7 @@ const deserializeAws_json1_1DescribeServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -836,7 +836,7 @@ const deserializeAws_json1_1DisassociateNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -883,7 +883,7 @@ const deserializeAws_json1_1ExportServerEngineAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -930,7 +930,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -974,7 +974,7 @@ const deserializeAws_json1_1RestoreServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1021,7 +1021,7 @@ const deserializeAws_json1_1StartMaintenanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1068,7 +1068,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1115,7 +1115,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1162,7 +1162,7 @@ const deserializeAws_json1_1UpdateServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1209,7 +1209,7 @@ const deserializeAws_json1_1UpdateServerEngineAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1971,6 +1971,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-organizations/src/protocols/Aws_json1_1.ts b/clients/client-organizations/src/protocols/Aws_json1_1.ts index aa7b1a589534..413feb3f1a0a 100644 --- a/clients/client-organizations/src/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/src/protocols/Aws_json1_1.ts @@ -996,7 +996,7 @@ const deserializeAws_json1_1AcceptHandshakeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1064,7 +1064,7 @@ const deserializeAws_json1_1AttachPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1141,7 +1141,7 @@ const deserializeAws_json1_1CancelHandshakeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_json1_1CloseAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1271,7 +1271,7 @@ const deserializeAws_json1_1CreateAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1336,7 +1336,7 @@ const deserializeAws_json1_1CreateGovCloudAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1401,7 +1401,7 @@ const deserializeAws_json1_1CreateOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1463,7 +1463,7 @@ const deserializeAws_json1_1CreateOrganizationalUnitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_json1_1CreatePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1599,7 +1599,7 @@ const deserializeAws_json1_1DeclineHandshakeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1658,7 +1658,7 @@ const deserializeAws_json1_1DeleteOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1714,7 +1714,7 @@ const deserializeAws_json1_1DeleteOrganizationalUnitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1773,7 +1773,7 @@ const deserializeAws_json1_1DeletePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1835,7 +1835,7 @@ const deserializeAws_json1_1DeregisterDelegatedAdministratorCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1903,7 +1903,7 @@ const deserializeAws_json1_1DescribeAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1959,7 +1959,7 @@ const deserializeAws_json1_1DescribeCreateAccountStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2018,7 +2018,7 @@ const deserializeAws_json1_1DescribeEffectivePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2083,7 +2083,7 @@ const deserializeAws_json1_1DescribeHandshakeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2139,7 +2139,7 @@ const deserializeAws_json1_1DescribeOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2192,7 +2192,7 @@ const deserializeAws_json1_1DescribeOrganizationalUnitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2248,7 +2248,7 @@ const deserializeAws_json1_1DescribePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2304,7 +2304,7 @@ const deserializeAws_json1_1DetachPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2375,7 +2375,7 @@ const deserializeAws_json1_1DisableAWSServiceAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2437,7 +2437,7 @@ const deserializeAws_json1_1DisablePolicyTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2508,7 +2508,7 @@ const deserializeAws_json1_1EnableAllFeaturesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2564,7 +2564,7 @@ const deserializeAws_json1_1EnableAWSServiceAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2626,7 +2626,7 @@ const deserializeAws_json1_1EnablePolicyTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2700,7 +2700,7 @@ const deserializeAws_json1_1InviteAccountToOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2768,7 +2768,7 @@ const deserializeAws_json1_1LeaveOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2833,7 +2833,7 @@ const deserializeAws_json1_1ListAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2886,7 +2886,7 @@ const deserializeAws_json1_1ListAccountsForParentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2942,7 +2942,7 @@ const deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3001,7 +3001,7 @@ const deserializeAws_json1_1ListChildrenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3057,7 +3057,7 @@ const deserializeAws_json1_1ListCreateAccountStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3113,7 +3113,7 @@ const deserializeAws_json1_1ListDelegatedAdministratorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3172,7 +3172,7 @@ const deserializeAws_json1_1ListDelegatedServicesForAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3237,7 +3237,7 @@ const deserializeAws_json1_1ListHandshakesForAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3290,7 +3290,7 @@ const deserializeAws_json1_1ListHandshakesForOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3346,7 +3346,7 @@ const deserializeAws_json1_1ListOrganizationalUnitsForParentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3402,7 +3402,7 @@ const deserializeAws_json1_1ListParentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3458,7 +3458,7 @@ const deserializeAws_json1_1ListPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3514,7 +3514,7 @@ const deserializeAws_json1_1ListPoliciesForTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3573,7 +3573,7 @@ const deserializeAws_json1_1ListRootsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3626,7 +3626,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3682,7 +3682,7 @@ const deserializeAws_json1_1ListTargetsForPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3738,7 +3738,7 @@ const deserializeAws_json1_1MoveAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3803,7 +3803,7 @@ const deserializeAws_json1_1RegisterDelegatedAdministratorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3868,7 +3868,7 @@ const deserializeAws_json1_1RemoveAccountFromOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3930,7 +3930,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3989,7 +3989,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4051,7 +4051,7 @@ const deserializeAws_json1_1UpdateOrganizationalUnitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4113,7 +4113,7 @@ const deserializeAws_json1_1UpdatePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6468,6 +6468,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-outposts/src/protocols/Aws_restJson1.ts b/clients/client-outposts/src/protocols/Aws_restJson1.ts index d3f6ec384384..f03c34b97e3f 100644 --- a/clients/client-outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-outposts/src/protocols/Aws_restJson1.ts @@ -807,7 +807,7 @@ const deserializeAws_restJson1CancelOrderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -860,7 +860,7 @@ const deserializeAws_restJson1CreateOrderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -916,7 +916,7 @@ const deserializeAws_restJson1CreateOutpostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -972,7 +972,7 @@ const deserializeAws_restJson1CreateSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1022,7 +1022,7 @@ const deserializeAws_restJson1DeleteOutpostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1072,7 +1072,7 @@ const deserializeAws_restJson1DeleteSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1125,7 +1125,7 @@ const deserializeAws_restJson1GetCatalogItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1175,7 +1175,7 @@ const deserializeAws_restJson1GetConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1225,7 +1225,7 @@ const deserializeAws_restJson1GetOrderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1272,7 +1272,7 @@ const deserializeAws_restJson1GetOutpostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1331,7 +1331,7 @@ const deserializeAws_restJson1GetOutpostInstanceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1381,7 +1381,7 @@ const deserializeAws_restJson1GetSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1437,7 +1437,7 @@ const deserializeAws_restJson1GetSiteAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1490,7 +1490,7 @@ const deserializeAws_restJson1ListAssetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1543,7 +1543,7 @@ const deserializeAws_restJson1ListCatalogItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1593,7 +1593,7 @@ const deserializeAws_restJson1ListOrdersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1646,7 +1646,7 @@ const deserializeAws_restJson1ListOutpostsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1696,7 +1696,7 @@ const deserializeAws_restJson1ListSitesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1743,7 +1743,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1793,7 +1793,7 @@ const deserializeAws_restJson1StartConnectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1884,7 +1884,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1931,7 +1931,7 @@ const deserializeAws_restJson1UpdateOutpostCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1984,7 +1984,7 @@ const deserializeAws_restJson1UpdateSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2040,7 +2040,7 @@ const deserializeAws_restJson1UpdateSiteAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2093,7 +2093,7 @@ const deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2727,6 +2727,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-panorama/src/protocols/Aws_restJson1.ts b/clients/client-panorama/src/protocols/Aws_restJson1.ts index 7e1427a50449..cd38374b88cb 100644 --- a/clients/client-panorama/src/protocols/Aws_restJson1.ts +++ b/clients/client-panorama/src/protocols/Aws_restJson1.ts @@ -1090,7 +1090,7 @@ const deserializeAws_restJson1CreateApplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1140,7 +1140,7 @@ const deserializeAws_restJson1CreateJobForDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1193,7 +1193,7 @@ const deserializeAws_restJson1CreateNodeFromTemplateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1249,7 +1249,7 @@ const deserializeAws_restJson1CreatePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1299,7 +1299,7 @@ const deserializeAws_restJson1CreatePackageImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1349,7 +1349,7 @@ const deserializeAws_restJson1DeleteDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1399,7 +1399,7 @@ const deserializeAws_restJson1DeletePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1449,7 +1449,7 @@ const deserializeAws_restJson1DeregisterPackageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1541,7 +1541,7 @@ const deserializeAws_restJson1DescribeApplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1618,7 +1618,7 @@ const deserializeAws_restJson1DescribeApplicationInstanceDetailsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1728,7 +1728,7 @@ const deserializeAws_restJson1DescribeDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1799,7 +1799,7 @@ const deserializeAws_restJson1DescribeDeviceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1891,7 +1891,7 @@ const deserializeAws_restJson1DescribeNodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1977,7 +1977,7 @@ const deserializeAws_restJson1DescribeNodeFromTemplateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2051,7 +2051,7 @@ const deserializeAws_restJson1DescribePackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2134,7 +2134,7 @@ const deserializeAws_restJson1DescribePackageImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2211,7 +2211,7 @@ const deserializeAws_restJson1DescribePackageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2267,7 +2267,7 @@ const deserializeAws_restJson1ListApplicationInstanceDependenciesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2314,7 +2314,7 @@ const deserializeAws_restJson1ListApplicationInstanceNodeInstancesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2361,7 +2361,7 @@ const deserializeAws_restJson1ListApplicationInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2408,7 +2408,7 @@ const deserializeAws_restJson1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2461,7 +2461,7 @@ const deserializeAws_restJson1ListDevicesJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2517,7 +2517,7 @@ const deserializeAws_restJson1ListNodeFromTemplateJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2570,7 +2570,7 @@ const deserializeAws_restJson1ListNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2620,7 +2620,7 @@ const deserializeAws_restJson1ListPackageImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2673,7 +2673,7 @@ const deserializeAws_restJson1ListPackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2726,7 +2726,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2785,7 +2785,7 @@ const deserializeAws_restJson1ProvisionDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2835,7 +2835,7 @@ const deserializeAws_restJson1RegisterPackageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2882,7 +2882,7 @@ const deserializeAws_restJson1RemoveApplicationInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2932,7 +2932,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2976,7 +2976,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3023,7 +3023,7 @@ const deserializeAws_restJson1UpdateDeviceMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4101,6 +4101,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts index f5c83e98c64f..e799e80a81f3 100644 --- a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts @@ -124,7 +124,7 @@ const deserializeAws_restJson1PutEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -162,7 +162,7 @@ const deserializeAws_restJson1PutItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -206,7 +206,7 @@ const deserializeAws_restJson1PutUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -372,6 +372,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts index 0fb5134a5296..d8614e756ff6 100644 --- a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts @@ -114,7 +114,7 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -161,7 +161,7 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -320,6 +320,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-personalize/src/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts index 2aa438b1ee27..ba7a80564eaf 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -1128,7 +1128,7 @@ const deserializeAws_json1_1CreateBatchInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1184,7 +1184,7 @@ const deserializeAws_json1_1CreateBatchSegmentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1240,7 +1240,7 @@ const deserializeAws_json1_1CreateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1296,7 +1296,7 @@ const deserializeAws_json1_1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1352,7 +1352,7 @@ const deserializeAws_json1_1CreateDatasetExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1408,7 +1408,7 @@ const deserializeAws_json1_1CreateDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1458,7 +1458,7 @@ const deserializeAws_json1_1CreateDatasetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1514,7 +1514,7 @@ const deserializeAws_json1_1CreateEventTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1570,7 +1570,7 @@ const deserializeAws_json1_1CreateFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1623,7 +1623,7 @@ const deserializeAws_json1_1CreateRecommenderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1679,7 +1679,7 @@ const deserializeAws_json1_1CreateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1726,7 +1726,7 @@ const deserializeAws_json1_1CreateSolutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1782,7 +1782,7 @@ const deserializeAws_json1_1CreateSolutionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1832,7 +1832,7 @@ const deserializeAws_json1_1DeleteCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1876,7 +1876,7 @@ const deserializeAws_json1_1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1920,7 +1920,7 @@ const deserializeAws_json1_1DeleteDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1964,7 +1964,7 @@ const deserializeAws_json1_1DeleteEventTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2008,7 +2008,7 @@ const deserializeAws_json1_1DeleteFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2052,7 +2052,7 @@ const deserializeAws_json1_1DeleteRecommenderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2096,7 +2096,7 @@ const deserializeAws_json1_1DeleteSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2140,7 +2140,7 @@ const deserializeAws_json1_1DeleteSolutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2187,7 +2187,7 @@ const deserializeAws_json1_1DescribeAlgorithmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2231,7 +2231,7 @@ const deserializeAws_json1_1DescribeBatchInferenceJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_json1_1DescribeBatchSegmentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2319,7 +2319,7 @@ const deserializeAws_json1_1DescribeCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2363,7 +2363,7 @@ const deserializeAws_json1_1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2407,7 +2407,7 @@ const deserializeAws_json1_1DescribeDatasetExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2451,7 +2451,7 @@ const deserializeAws_json1_1DescribeDatasetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2495,7 +2495,7 @@ const deserializeAws_json1_1DescribeDatasetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2539,7 +2539,7 @@ const deserializeAws_json1_1DescribeEventTrackerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2583,7 +2583,7 @@ const deserializeAws_json1_1DescribeFeatureTransformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2627,7 +2627,7 @@ const deserializeAws_json1_1DescribeFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2671,7 +2671,7 @@ const deserializeAws_json1_1DescribeRecipeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2715,7 +2715,7 @@ const deserializeAws_json1_1DescribeRecommenderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2759,7 +2759,7 @@ const deserializeAws_json1_1DescribeSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2803,7 +2803,7 @@ const deserializeAws_json1_1DescribeSolutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2847,7 +2847,7 @@ const deserializeAws_json1_1DescribeSolutionVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2891,7 +2891,7 @@ const deserializeAws_json1_1GetSolutionMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2938,7 +2938,7 @@ const deserializeAws_json1_1ListBatchInferenceJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2982,7 +2982,7 @@ const deserializeAws_json1_1ListBatchSegmentJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3026,7 +3026,7 @@ const deserializeAws_json1_1ListCampaignsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3070,7 +3070,7 @@ const deserializeAws_json1_1ListDatasetExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3114,7 +3114,7 @@ const deserializeAws_json1_1ListDatasetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3155,7 +3155,7 @@ const deserializeAws_json1_1ListDatasetImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3199,7 +3199,7 @@ const deserializeAws_json1_1ListDatasetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3243,7 +3243,7 @@ const deserializeAws_json1_1ListEventTrackersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3287,7 +3287,7 @@ const deserializeAws_json1_1ListFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3331,7 +3331,7 @@ const deserializeAws_json1_1ListRecipesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3375,7 +3375,7 @@ const deserializeAws_json1_1ListRecommendersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3419,7 +3419,7 @@ const deserializeAws_json1_1ListSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3460,7 +3460,7 @@ const deserializeAws_json1_1ListSolutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3504,7 +3504,7 @@ const deserializeAws_json1_1ListSolutionVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3551,7 +3551,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3598,7 +3598,7 @@ const deserializeAws_json1_1StartRecommenderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3645,7 +3645,7 @@ const deserializeAws_json1_1StopRecommenderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3689,7 +3689,7 @@ const deserializeAws_json1_1StopSolutionVersionCreationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3736,7 +3736,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3789,7 +3789,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3839,7 +3839,7 @@ const deserializeAws_json1_1UpdateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3886,7 +3886,7 @@ const deserializeAws_json1_1UpdateRecommenderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6752,6 +6752,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-pi/src/protocols/Aws_json1_1.ts b/clients/client-pi/src/protocols/Aws_json1_1.ts index 7e1d85859246..9aa94e586839 100644 --- a/clients/client-pi/src/protocols/Aws_json1_1.ts +++ b/clients/client-pi/src/protocols/Aws_json1_1.ts @@ -170,7 +170,7 @@ const deserializeAws_json1_1DescribeDimensionKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -217,7 +217,7 @@ const deserializeAws_json1_1GetDimensionKeyDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -264,7 +264,7 @@ const deserializeAws_json1_1GetResourceMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -311,7 +311,7 @@ const deserializeAws_json1_1GetResourceMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -358,7 +358,7 @@ const deserializeAws_json1_1ListAvailableResourceDimensionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -405,7 +405,7 @@ const deserializeAws_json1_1ListAvailableResourceMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1056,6 +1056,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts index ca2c23fccb4a..240daad44292 100644 --- a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts @@ -1448,7 +1448,7 @@ const deserializeAws_restJson1CreateConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1501,7 +1501,7 @@ const deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1551,7 +1551,7 @@ const deserializeAws_restJson1CreateDedicatedIpPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1607,7 +1607,7 @@ const deserializeAws_restJson1CreateDeliverabilityTestReportCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1678,7 +1678,7 @@ const deserializeAws_restJson1CreateEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1725,7 +1725,7 @@ const deserializeAws_restJson1DeleteConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1772,7 +1772,7 @@ const deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1816,7 +1816,7 @@ const deserializeAws_restJson1DeleteDedicatedIpPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1863,7 +1863,7 @@ const deserializeAws_restJson1DeleteEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1925,7 +1925,7 @@ const deserializeAws_restJson1GetAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1969,7 +1969,7 @@ const deserializeAws_restJson1GetBlacklistReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2031,7 +2031,7 @@ const deserializeAws_restJson1GetConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2078,7 +2078,7 @@ const deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2125,7 +2125,7 @@ const deserializeAws_restJson1GetDedicatedIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2175,7 +2175,7 @@ const deserializeAws_restJson1GetDedicatedIpsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2242,7 +2242,7 @@ const deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2304,7 +2304,7 @@ const deserializeAws_restJson1GetDeliverabilityTestReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2354,7 +2354,7 @@ const deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2404,7 +2404,7 @@ const deserializeAws_restJson1GetDomainStatisticsReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2466,7 +2466,7 @@ const deserializeAws_restJson1GetEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2516,7 +2516,7 @@ const deserializeAws_restJson1ListConfigurationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2563,7 +2563,7 @@ const deserializeAws_restJson1ListDedicatedIpPoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2613,7 +2613,7 @@ const deserializeAws_restJson1ListDeliverabilityTestReportsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2666,7 +2666,7 @@ const deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2716,7 +2716,7 @@ const deserializeAws_restJson1ListEmailIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2760,7 +2760,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2804,7 +2804,7 @@ const deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2845,7 +2845,7 @@ const deserializeAws_restJson1PutAccountSendingAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2886,7 +2886,7 @@ const deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2930,7 +2930,7 @@ const deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2974,7 +2974,7 @@ const deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3018,7 +3018,7 @@ const deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3062,7 +3062,7 @@ const deserializeAws_restJson1PutDedicatedIpInPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3106,7 +3106,7 @@ const deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3150,7 +3150,7 @@ const deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3200,7 +3200,7 @@ const deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3244,7 +3244,7 @@ const deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3288,7 +3288,7 @@ const deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3335,7 +3335,7 @@ const deserializeAws_restJson1SendEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3394,7 +3394,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3441,7 +3441,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3488,7 +3488,7 @@ const deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4515,6 +4515,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts index f070c92b501a..2e14e81683d9 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts @@ -841,7 +841,7 @@ const deserializeAws_json1_0AssociateOriginationIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -900,7 +900,7 @@ const deserializeAws_json1_0CreateConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -956,7 +956,7 @@ const deserializeAws_json1_0CreateEventDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1015,7 +1015,7 @@ const deserializeAws_json1_0CreateOptOutListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1071,7 +1071,7 @@ const deserializeAws_json1_0CreatePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1130,7 +1130,7 @@ const deserializeAws_json1_0DeleteConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1183,7 +1183,7 @@ const deserializeAws_json1_0DeleteDefaultMessageTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1236,7 +1236,7 @@ const deserializeAws_json1_0DeleteDefaultSenderIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1289,7 +1289,7 @@ const deserializeAws_json1_0DeleteEventDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1342,7 +1342,7 @@ const deserializeAws_json1_0DeleteKeywordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1398,7 +1398,7 @@ const deserializeAws_json1_0DeleteOptedOutNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1454,7 +1454,7 @@ const deserializeAws_json1_0DeleteOptOutListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1510,7 +1510,7 @@ const deserializeAws_json1_0DeletePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1566,7 +1566,7 @@ const deserializeAws_json1_0DeleteTextMessageSpendLimitOverrideCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1616,7 +1616,7 @@ const deserializeAws_json1_0DeleteVoiceMessageSpendLimitOverrideCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1666,7 +1666,7 @@ const deserializeAws_json1_0DescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1716,7 +1716,7 @@ const deserializeAws_json1_0DescribeAccountLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1766,7 +1766,7 @@ const deserializeAws_json1_0DescribeConfigurationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1819,7 +1819,7 @@ const deserializeAws_json1_0DescribeKeywordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1872,7 +1872,7 @@ const deserializeAws_json1_0DescribeOptedOutNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1925,7 +1925,7 @@ const deserializeAws_json1_0DescribeOptOutListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1978,7 +1978,7 @@ const deserializeAws_json1_0DescribePhoneNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2031,7 +2031,7 @@ const deserializeAws_json1_0DescribePoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2084,7 +2084,7 @@ const deserializeAws_json1_0DescribeSenderIdsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2137,7 +2137,7 @@ const deserializeAws_json1_0DescribeSpendLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2187,7 +2187,7 @@ const deserializeAws_json1_0DisassociateOriginationIdentityCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2243,7 +2243,7 @@ const deserializeAws_json1_0ListPoolOriginationIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2296,7 +2296,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2349,7 +2349,7 @@ const deserializeAws_json1_0PutKeywordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2408,7 +2408,7 @@ const deserializeAws_json1_0PutOptedOutNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2461,7 +2461,7 @@ const deserializeAws_json1_0ReleasePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2517,7 +2517,7 @@ const deserializeAws_json1_0RequestPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2576,7 +2576,7 @@ const deserializeAws_json1_0SendTextMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2635,7 +2635,7 @@ const deserializeAws_json1_0SendVoiceMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2694,7 +2694,7 @@ const deserializeAws_json1_0SetDefaultMessageTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2747,7 +2747,7 @@ const deserializeAws_json1_0SetDefaultSenderIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2800,7 +2800,7 @@ const deserializeAws_json1_0SetTextMessageSpendLimitOverrideCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2850,7 +2850,7 @@ const deserializeAws_json1_0SetVoiceMessageSpendLimitOverrideCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2900,7 +2900,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2956,7 +2956,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3009,7 +3009,7 @@ const deserializeAws_json1_0UpdateEventDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3065,7 +3065,7 @@ const deserializeAws_json1_0UpdatePhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3121,7 +3121,7 @@ const deserializeAws_json1_0UpdatePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5147,6 +5147,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts index fa9e1a0ac260..0c3e63a6896d 100644 --- a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts @@ -341,7 +341,7 @@ const deserializeAws_restJson1CreateConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -391,7 +391,7 @@ const deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -444,7 +444,7 @@ const deserializeAws_restJson1DeleteConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -491,7 +491,7 @@ const deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -541,7 +541,7 @@ const deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -594,7 +594,7 @@ const deserializeAws_restJson1ListConfigurationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -641,7 +641,7 @@ const deserializeAws_restJson1SendVoiceMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -685,7 +685,7 @@ const deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1031,6 +1031,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts index a58832524076..7cb67dc97d23 100644 --- a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts @@ -4441,7 +4441,7 @@ const deserializeAws_restJson1CreateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4498,7 +4498,7 @@ const deserializeAws_restJson1CreateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4555,7 +4555,7 @@ const deserializeAws_restJson1CreateEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4606,7 +4606,7 @@ const deserializeAws_restJson1CreateExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4663,7 +4663,7 @@ const deserializeAws_restJson1CreateImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4720,7 +4720,7 @@ const deserializeAws_restJson1CreateInAppTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4771,7 +4771,7 @@ const deserializeAws_restJson1CreateJourneyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4828,7 +4828,7 @@ const deserializeAws_restJson1CreatePushTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4879,7 +4879,7 @@ const deserializeAws_restJson1CreateRecommenderConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4936,7 +4936,7 @@ const deserializeAws_restJson1CreateSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4993,7 +4993,7 @@ const deserializeAws_restJson1CreateSmsTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5044,7 +5044,7 @@ const deserializeAws_restJson1CreateVoiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5095,7 +5095,7 @@ const deserializeAws_restJson1DeleteAdmChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5152,7 +5152,7 @@ const deserializeAws_restJson1DeleteApnsChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5209,7 +5209,7 @@ const deserializeAws_restJson1DeleteApnsSandboxChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5266,7 +5266,7 @@ const deserializeAws_restJson1DeleteApnsVoipChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5323,7 +5323,7 @@ const deserializeAws_restJson1DeleteApnsVoipSandboxChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5380,7 +5380,7 @@ const deserializeAws_restJson1DeleteAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5437,7 +5437,7 @@ const deserializeAws_restJson1DeleteBaiduChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5494,7 +5494,7 @@ const deserializeAws_restJson1DeleteCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5551,7 +5551,7 @@ const deserializeAws_restJson1DeleteEmailChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5608,7 +5608,7 @@ const deserializeAws_restJson1DeleteEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5665,7 +5665,7 @@ const deserializeAws_restJson1DeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5722,7 +5722,7 @@ const deserializeAws_restJson1DeleteEventStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5779,7 +5779,7 @@ const deserializeAws_restJson1DeleteGcmChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5836,7 +5836,7 @@ const deserializeAws_restJson1DeleteInAppTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5893,7 +5893,7 @@ const deserializeAws_restJson1DeleteJourneyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5950,7 +5950,7 @@ const deserializeAws_restJson1DeletePushTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6007,7 +6007,7 @@ const deserializeAws_restJson1DeleteRecommenderConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6064,7 +6064,7 @@ const deserializeAws_restJson1DeleteSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6121,7 +6121,7 @@ const deserializeAws_restJson1DeleteSmsChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6178,7 +6178,7 @@ const deserializeAws_restJson1DeleteSmsTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6235,7 +6235,7 @@ const deserializeAws_restJson1DeleteUserEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6292,7 +6292,7 @@ const deserializeAws_restJson1DeleteVoiceChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6349,7 +6349,7 @@ const deserializeAws_restJson1DeleteVoiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6406,7 +6406,7 @@ const deserializeAws_restJson1GetAdmChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6463,7 +6463,7 @@ const deserializeAws_restJson1GetApnsChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6520,7 +6520,7 @@ const deserializeAws_restJson1GetApnsSandboxChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6577,7 +6577,7 @@ const deserializeAws_restJson1GetApnsVoipChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6634,7 +6634,7 @@ const deserializeAws_restJson1GetApnsVoipSandboxChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6691,7 +6691,7 @@ const deserializeAws_restJson1GetAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6748,7 +6748,7 @@ const deserializeAws_restJson1GetApplicationDateRangeKpiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6805,7 +6805,7 @@ const deserializeAws_restJson1GetApplicationSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6862,7 +6862,7 @@ const deserializeAws_restJson1GetAppsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6919,7 +6919,7 @@ const deserializeAws_restJson1GetBaiduChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6976,7 +6976,7 @@ const deserializeAws_restJson1GetCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7033,7 +7033,7 @@ const deserializeAws_restJson1GetCampaignActivitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7090,7 +7090,7 @@ const deserializeAws_restJson1GetCampaignDateRangeKpiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7147,7 +7147,7 @@ const deserializeAws_restJson1GetCampaignsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7204,7 +7204,7 @@ const deserializeAws_restJson1GetCampaignVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7261,7 +7261,7 @@ const deserializeAws_restJson1GetCampaignVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7318,7 +7318,7 @@ const deserializeAws_restJson1GetChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7375,7 +7375,7 @@ const deserializeAws_restJson1GetEmailChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7432,7 +7432,7 @@ const deserializeAws_restJson1GetEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7489,7 +7489,7 @@ const deserializeAws_restJson1GetEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7546,7 +7546,7 @@ const deserializeAws_restJson1GetEventStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7603,7 +7603,7 @@ const deserializeAws_restJson1GetExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7660,7 +7660,7 @@ const deserializeAws_restJson1GetExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7717,7 +7717,7 @@ const deserializeAws_restJson1GetGcmChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7774,7 +7774,7 @@ const deserializeAws_restJson1GetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7831,7 +7831,7 @@ const deserializeAws_restJson1GetImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7888,7 +7888,7 @@ const deserializeAws_restJson1GetInAppMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7945,7 +7945,7 @@ const deserializeAws_restJson1GetInAppTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8002,7 +8002,7 @@ const deserializeAws_restJson1GetJourneyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8059,7 +8059,7 @@ const deserializeAws_restJson1GetJourneyDateRangeKpiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8119,7 +8119,7 @@ const deserializeAws_restJson1GetJourneyExecutionActivityMetricsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8176,7 +8176,7 @@ const deserializeAws_restJson1GetJourneyExecutionMetricsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8233,7 +8233,7 @@ const deserializeAws_restJson1GetPushTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8290,7 +8290,7 @@ const deserializeAws_restJson1GetRecommenderConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8350,7 +8350,7 @@ const deserializeAws_restJson1GetRecommenderConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8407,7 +8407,7 @@ const deserializeAws_restJson1GetSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8464,7 +8464,7 @@ const deserializeAws_restJson1GetSegmentExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8521,7 +8521,7 @@ const deserializeAws_restJson1GetSegmentImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8578,7 +8578,7 @@ const deserializeAws_restJson1GetSegmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8635,7 +8635,7 @@ const deserializeAws_restJson1GetSegmentVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8692,7 +8692,7 @@ const deserializeAws_restJson1GetSegmentVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8749,7 +8749,7 @@ const deserializeAws_restJson1GetSmsChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8806,7 +8806,7 @@ const deserializeAws_restJson1GetSmsTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8863,7 +8863,7 @@ const deserializeAws_restJson1GetUserEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8920,7 +8920,7 @@ const deserializeAws_restJson1GetVoiceChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8977,7 +8977,7 @@ const deserializeAws_restJson1GetVoiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9034,7 +9034,7 @@ const deserializeAws_restJson1ListJourneysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9091,7 +9091,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9124,7 +9124,7 @@ const deserializeAws_restJson1ListTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9175,7 +9175,7 @@ const deserializeAws_restJson1ListTemplateVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9232,7 +9232,7 @@ const deserializeAws_restJson1PhoneNumberValidateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9289,7 +9289,7 @@ const deserializeAws_restJson1PutEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9346,7 +9346,7 @@ const deserializeAws_restJson1PutEventStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9403,7 +9403,7 @@ const deserializeAws_restJson1RemoveAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9460,7 +9460,7 @@ const deserializeAws_restJson1SendMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9517,7 +9517,7 @@ const deserializeAws_restJson1SendOTPMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9574,7 +9574,7 @@ const deserializeAws_restJson1SendUsersMessagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9630,7 +9630,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9662,7 +9662,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9695,7 +9695,7 @@ const deserializeAws_restJson1UpdateAdmChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9752,7 +9752,7 @@ const deserializeAws_restJson1UpdateApnsChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9809,7 +9809,7 @@ const deserializeAws_restJson1UpdateApnsSandboxChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9866,7 +9866,7 @@ const deserializeAws_restJson1UpdateApnsVoipChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9923,7 +9923,7 @@ const deserializeAws_restJson1UpdateApnsVoipSandboxChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9980,7 +9980,7 @@ const deserializeAws_restJson1UpdateApplicationSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10037,7 +10037,7 @@ const deserializeAws_restJson1UpdateBaiduChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10094,7 +10094,7 @@ const deserializeAws_restJson1UpdateCampaignCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10151,7 +10151,7 @@ const deserializeAws_restJson1UpdateEmailChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10208,7 +10208,7 @@ const deserializeAws_restJson1UpdateEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10265,7 +10265,7 @@ const deserializeAws_restJson1UpdateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10322,7 +10322,7 @@ const deserializeAws_restJson1UpdateEndpointsBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10379,7 +10379,7 @@ const deserializeAws_restJson1UpdateGcmChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10436,7 +10436,7 @@ const deserializeAws_restJson1UpdateInAppTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10493,7 +10493,7 @@ const deserializeAws_restJson1UpdateJourneyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10553,7 +10553,7 @@ const deserializeAws_restJson1UpdateJourneyStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10610,7 +10610,7 @@ const deserializeAws_restJson1UpdatePushTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10667,7 +10667,7 @@ const deserializeAws_restJson1UpdateRecommenderConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10724,7 +10724,7 @@ const deserializeAws_restJson1UpdateSegmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10781,7 +10781,7 @@ const deserializeAws_restJson1UpdateSmsChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10838,7 +10838,7 @@ const deserializeAws_restJson1UpdateSmsTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10895,7 +10895,7 @@ const deserializeAws_restJson1UpdateTemplateActiveVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10952,7 +10952,7 @@ const deserializeAws_restJson1UpdateVoiceChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11009,7 +11009,7 @@ const deserializeAws_restJson1UpdateVoiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11066,7 +11066,7 @@ const deserializeAws_restJson1VerifyOTPMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15395,6 +15395,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-polly/src/protocols/Aws_restJson1.ts b/clients/client-polly/src/protocols/Aws_restJson1.ts index 68aaba8e4722..f1313a32f809 100644 --- a/clients/client-polly/src/protocols/Aws_restJson1.ts +++ b/clients/client-polly/src/protocols/Aws_restJson1.ts @@ -329,7 +329,7 @@ const deserializeAws_restJson1DeleteLexiconCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -376,7 +376,7 @@ const deserializeAws_restJson1DescribeVoicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -423,7 +423,7 @@ const deserializeAws_restJson1GetLexiconCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -467,7 +467,7 @@ const deserializeAws_restJson1GetSpeechSynthesisTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -517,7 +517,7 @@ const deserializeAws_restJson1ListLexiconsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -564,7 +564,7 @@ const deserializeAws_restJson1ListSpeechSynthesisTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -605,7 +605,7 @@ const deserializeAws_restJson1PutLexiconCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -664,7 +664,7 @@ const deserializeAws_restJson1StartSpeechSynthesisTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -741,7 +741,7 @@ const deserializeAws_restJson1SynthesizeSpeechCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1331,6 +1331,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-pricing/src/protocols/Aws_json1_1.ts b/clients/client-pricing/src/protocols/Aws_json1_1.ts index 728e872f377b..038ab2abaf81 100644 --- a/clients/client-pricing/src/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/src/protocols/Aws_json1_1.ts @@ -96,7 +96,7 @@ const deserializeAws_json1_1DescribeServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -149,7 +149,7 @@ const deserializeAws_json1_1GetAttributeValuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -202,7 +202,7 @@ const deserializeAws_json1_1GetProductsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -535,6 +535,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts index 7b0f74fd58e7..bb1361b23c8c 100644 --- a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts +++ b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts @@ -781,7 +781,7 @@ const deserializeAws_restJson1AcknowledgeOrderReceiptCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -831,7 +831,7 @@ const deserializeAws_restJson1ActivateDeviceIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -878,7 +878,7 @@ const deserializeAws_restJson1ActivateNetworkSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_restJson1ConfigureAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -975,7 +975,7 @@ const deserializeAws_restJson1CreateNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1025,7 +1025,7 @@ const deserializeAws_restJson1CreateNetworkSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1072,7 +1072,7 @@ const deserializeAws_restJson1DeactivateDeviceIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1119,7 +1119,7 @@ const deserializeAws_restJson1DeleteNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1166,7 +1166,7 @@ const deserializeAws_restJson1DeleteNetworkSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1216,7 +1216,7 @@ const deserializeAws_restJson1GetDeviceIdentifierCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1266,7 +1266,7 @@ const deserializeAws_restJson1GetNetworkCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1316,7 +1316,7 @@ const deserializeAws_restJson1GetNetworkResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1366,7 +1366,7 @@ const deserializeAws_restJson1GetNetworkSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1416,7 +1416,7 @@ const deserializeAws_restJson1GetOrderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1466,7 +1466,7 @@ const deserializeAws_restJson1ListDeviceIdentifiersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1516,7 +1516,7 @@ const deserializeAws_restJson1ListNetworkResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1566,7 +1566,7 @@ const deserializeAws_restJson1ListNetworksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1616,7 +1616,7 @@ const deserializeAws_restJson1ListNetworkSitesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1666,7 +1666,7 @@ const deserializeAws_restJson1ListOrdersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1713,7 +1713,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1766,7 +1766,7 @@ const deserializeAws_restJson1PingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1804,7 +1804,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1854,7 +1854,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1910,7 +1910,7 @@ const deserializeAws_restJson1UpdateNetworkSiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1960,7 +1960,7 @@ const deserializeAws_restJson1UpdateNetworkSitePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2618,6 +2618,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-proton/src/protocols/Aws_json1_0.ts b/clients/client-proton/src/protocols/Aws_json1_0.ts index 6cc0ae0483a4..34bfee577253 100644 --- a/clients/client-proton/src/protocols/Aws_json1_0.ts +++ b/clients/client-proton/src/protocols/Aws_json1_0.ts @@ -1444,7 +1444,7 @@ const deserializeAws_json1_0AcceptEnvironmentAccountConnectionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1500,7 +1500,7 @@ const deserializeAws_json1_0CancelComponentDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1556,7 +1556,7 @@ const deserializeAws_json1_0CancelEnvironmentDeploymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1612,7 +1612,7 @@ const deserializeAws_json1_0CancelServiceInstanceDeploymentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1668,7 +1668,7 @@ const deserializeAws_json1_0CancelServicePipelineDeploymentCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1724,7 +1724,7 @@ const deserializeAws_json1_0CreateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1783,7 +1783,7 @@ const deserializeAws_json1_0CreateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1842,7 +1842,7 @@ const deserializeAws_json1_0CreateEnvironmentAccountConnectionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1898,7 +1898,7 @@ const deserializeAws_json1_0CreateEnvironmentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1954,7 +1954,7 @@ const deserializeAws_json1_0CreateEnvironmentTemplateVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2013,7 +2013,7 @@ const deserializeAws_json1_0CreateRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2069,7 +2069,7 @@ const deserializeAws_json1_0CreateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2128,7 +2128,7 @@ const deserializeAws_json1_0CreateServiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2184,7 +2184,7 @@ const deserializeAws_json1_0CreateServiceTemplateVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2243,7 +2243,7 @@ const deserializeAws_json1_0CreateTemplateSyncConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2299,7 +2299,7 @@ const deserializeAws_json1_0DeleteComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2355,7 +2355,7 @@ const deserializeAws_json1_0DeleteEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2411,7 +2411,7 @@ const deserializeAws_json1_0DeleteEnvironmentAccountConnectionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2467,7 +2467,7 @@ const deserializeAws_json1_0DeleteEnvironmentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2523,7 +2523,7 @@ const deserializeAws_json1_0DeleteEnvironmentTemplateVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2579,7 +2579,7 @@ const deserializeAws_json1_0DeleteRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2635,7 +2635,7 @@ const deserializeAws_json1_0DeleteServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2691,7 +2691,7 @@ const deserializeAws_json1_0DeleteServiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2747,7 +2747,7 @@ const deserializeAws_json1_0DeleteServiceTemplateVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2803,7 +2803,7 @@ const deserializeAws_json1_0DeleteTemplateSyncConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2859,7 +2859,7 @@ const deserializeAws_json1_0GetAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2912,7 +2912,7 @@ const deserializeAws_json1_0GetComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2965,7 +2965,7 @@ const deserializeAws_json1_0GetEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3018,7 +3018,7 @@ const deserializeAws_json1_0GetEnvironmentAccountConnectionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3071,7 +3071,7 @@ const deserializeAws_json1_0GetEnvironmentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3124,7 +3124,7 @@ const deserializeAws_json1_0GetEnvironmentTemplateVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3177,7 +3177,7 @@ const deserializeAws_json1_0GetRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3230,7 +3230,7 @@ const deserializeAws_json1_0GetRepositorySyncStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3283,7 +3283,7 @@ const deserializeAws_json1_0GetServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3336,7 +3336,7 @@ const deserializeAws_json1_0GetServiceInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3389,7 +3389,7 @@ const deserializeAws_json1_0GetServiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3442,7 +3442,7 @@ const deserializeAws_json1_0GetServiceTemplateVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3495,7 +3495,7 @@ const deserializeAws_json1_0GetTemplateSyncConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3548,7 +3548,7 @@ const deserializeAws_json1_0GetTemplateSyncStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3601,7 +3601,7 @@ const deserializeAws_json1_0ListComponentOutputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3654,7 +3654,7 @@ const deserializeAws_json1_0ListComponentProvisionedResourcesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3707,7 +3707,7 @@ const deserializeAws_json1_0ListComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3757,7 +3757,7 @@ const deserializeAws_json1_0ListEnvironmentAccountConnectionsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3807,7 +3807,7 @@ const deserializeAws_json1_0ListEnvironmentOutputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3860,7 +3860,7 @@ const deserializeAws_json1_0ListEnvironmentProvisionedResourcesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3913,7 +3913,7 @@ const deserializeAws_json1_0ListEnvironmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3966,7 +3966,7 @@ const deserializeAws_json1_0ListEnvironmentTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4016,7 +4016,7 @@ const deserializeAws_json1_0ListEnvironmentTemplateVersionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4069,7 +4069,7 @@ const deserializeAws_json1_0ListRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4122,7 +4122,7 @@ const deserializeAws_json1_0ListRepositorySyncDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4172,7 +4172,7 @@ const deserializeAws_json1_0ListServiceInstanceOutputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4225,7 +4225,7 @@ const deserializeAws_json1_0ListServiceInstanceProvisionedResourcesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4278,7 +4278,7 @@ const deserializeAws_json1_0ListServiceInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4331,7 +4331,7 @@ const deserializeAws_json1_0ListServicePipelineOutputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4384,7 +4384,7 @@ const deserializeAws_json1_0ListServicePipelineProvisionedResourcesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4437,7 +4437,7 @@ const deserializeAws_json1_0ListServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4487,7 +4487,7 @@ const deserializeAws_json1_0ListServiceTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4537,7 +4537,7 @@ const deserializeAws_json1_0ListServiceTemplateVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4590,7 +4590,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4643,7 +4643,7 @@ const deserializeAws_json1_0NotifyResourceDeploymentStatusChangeCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4702,7 +4702,7 @@ const deserializeAws_json1_0RejectEnvironmentAccountConnectionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4758,7 +4758,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4814,7 +4814,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4870,7 +4870,7 @@ const deserializeAws_json1_0UpdateAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4923,7 +4923,7 @@ const deserializeAws_json1_0UpdateComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4982,7 +4982,7 @@ const deserializeAws_json1_0UpdateEnvironmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5038,7 +5038,7 @@ const deserializeAws_json1_0UpdateEnvironmentAccountConnectionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5094,7 +5094,7 @@ const deserializeAws_json1_0UpdateEnvironmentTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5150,7 +5150,7 @@ const deserializeAws_json1_0UpdateEnvironmentTemplateVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5206,7 +5206,7 @@ const deserializeAws_json1_0UpdateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5265,7 +5265,7 @@ const deserializeAws_json1_0UpdateServiceInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5321,7 +5321,7 @@ const deserializeAws_json1_0UpdateServicePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5377,7 +5377,7 @@ const deserializeAws_json1_0UpdateServiceTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5433,7 +5433,7 @@ const deserializeAws_json1_0UpdateServiceTemplateVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5489,7 +5489,7 @@ const deserializeAws_json1_0UpdateTemplateSyncConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8265,6 +8265,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts index f2446935bdb1..344d53aa95c7 100644 --- a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts @@ -80,7 +80,7 @@ const deserializeAws_json1_0SendCommandCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -508,6 +508,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-qldb/src/protocols/Aws_restJson1.ts b/clients/client-qldb/src/protocols/Aws_restJson1.ts index b5dc75fea05c..05bc688280df 100644 --- a/clients/client-qldb/src/protocols/Aws_restJson1.ts +++ b/clients/client-qldb/src/protocols/Aws_restJson1.ts @@ -613,7 +613,7 @@ const deserializeAws_restJson1CancelJournalKinesisStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -678,7 +678,7 @@ const deserializeAws_restJson1CreateLedgerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -725,7 +725,7 @@ const deserializeAws_restJson1DeleteLedgerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -775,7 +775,7 @@ const deserializeAws_restJson1DescribeJournalKinesisStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -822,7 +822,7 @@ const deserializeAws_restJson1DescribeJournalS3ExportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -884,7 +884,7 @@ const deserializeAws_restJson1DescribeLedgerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -928,7 +928,7 @@ const deserializeAws_restJson1ExportJournalToS3CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -975,7 +975,7 @@ const deserializeAws_restJson1GetBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1025,7 +1025,7 @@ const deserializeAws_restJson1GetDigestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1075,7 +1075,7 @@ const deserializeAws_restJson1GetRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1125,7 +1125,7 @@ const deserializeAws_restJson1ListJournalKinesisStreamsForLedgerCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1175,7 +1175,7 @@ const deserializeAws_restJson1ListJournalS3ExportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1213,7 +1213,7 @@ const deserializeAws_restJson1ListJournalS3ExportsForLedgerCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1251,7 +1251,7 @@ const deserializeAws_restJson1ListLedgersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1286,7 +1286,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1330,7 +1330,7 @@ const deserializeAws_restJson1StreamJournalToKinesisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1374,7 +1374,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1415,7 +1415,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1477,7 +1477,7 @@ const deserializeAws_restJson1UpdateLedgerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1527,7 +1527,7 @@ const deserializeAws_restJson1UpdateLedgerPermissionsModeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1927,6 +1927,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-quicksight/src/protocols/Aws_restJson1.ts b/clients/client-quicksight/src/protocols/Aws_restJson1.ts index 2419dcc1f08f..8ce68622caea 100644 --- a/clients/client-quicksight/src/protocols/Aws_restJson1.ts +++ b/clients/client-quicksight/src/protocols/Aws_restJson1.ts @@ -4852,7 +4852,7 @@ const deserializeAws_restJson1CancelIngestionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4923,7 +4923,7 @@ const deserializeAws_restJson1CreateAccountCustomizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4991,7 +4991,7 @@ const deserializeAws_restJson1CreateAccountSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5068,7 +5068,7 @@ const deserializeAws_restJson1CreateAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5142,7 +5142,7 @@ const deserializeAws_restJson1CreateDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5216,7 +5216,7 @@ const deserializeAws_restJson1CreateDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5293,7 +5293,7 @@ const deserializeAws_restJson1CreateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5364,7 +5364,7 @@ const deserializeAws_restJson1CreateFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5435,7 +5435,7 @@ const deserializeAws_restJson1CreateFolderMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5503,7 +5503,7 @@ const deserializeAws_restJson1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5574,7 +5574,7 @@ const deserializeAws_restJson1CreateGroupMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5651,7 +5651,7 @@ const deserializeAws_restJson1CreateIAMPolicyAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5722,7 +5722,7 @@ const deserializeAws_restJson1CreateIngestionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5799,7 +5799,7 @@ const deserializeAws_restJson1CreateNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5882,7 +5882,7 @@ const deserializeAws_restJson1CreateTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5953,7 +5953,7 @@ const deserializeAws_restJson1CreateTemplateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6027,7 +6027,7 @@ const deserializeAws_restJson1CreateThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6095,7 +6095,7 @@ const deserializeAws_restJson1CreateThemeAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6160,7 +6160,7 @@ const deserializeAws_restJson1DeleteAccountCustomizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6231,7 +6231,7 @@ const deserializeAws_restJson1DeleteAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6296,7 +6296,7 @@ const deserializeAws_restJson1DeleteDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6361,7 +6361,7 @@ const deserializeAws_restJson1DeleteDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6423,7 +6423,7 @@ const deserializeAws_restJson1DeleteDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6485,7 +6485,7 @@ const deserializeAws_restJson1DeleteFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6550,7 +6550,7 @@ const deserializeAws_restJson1DeleteFolderMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6609,7 +6609,7 @@ const deserializeAws_restJson1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6671,7 +6671,7 @@ const deserializeAws_restJson1DeleteGroupMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6736,7 +6736,7 @@ const deserializeAws_restJson1DeleteIAMPolicyAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6798,7 +6798,7 @@ const deserializeAws_restJson1DeleteNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6866,7 +6866,7 @@ const deserializeAws_restJson1DeleteTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6937,7 +6937,7 @@ const deserializeAws_restJson1DeleteTemplateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6999,7 +6999,7 @@ const deserializeAws_restJson1DeleteThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7070,7 +7070,7 @@ const deserializeAws_restJson1DeleteThemeAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7129,7 +7129,7 @@ const deserializeAws_restJson1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7191,7 +7191,7 @@ const deserializeAws_restJson1DeleteUserByPrincipalIdCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7265,7 +7265,7 @@ const deserializeAws_restJson1DescribeAccountCustomizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7327,7 +7327,7 @@ const deserializeAws_restJson1DescribeAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7389,7 +7389,7 @@ const deserializeAws_restJson1DescribeAccountSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7451,7 +7451,7 @@ const deserializeAws_restJson1DescribeAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7519,7 +7519,7 @@ const deserializeAws_restJson1DescribeAnalysisPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7578,7 +7578,7 @@ const deserializeAws_restJson1DescribeDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7652,7 +7652,7 @@ const deserializeAws_restJson1DescribeDashboardPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7711,7 +7711,7 @@ const deserializeAws_restJson1DescribeDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7776,7 +7776,7 @@ const deserializeAws_restJson1DescribeDataSetPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7835,7 +7835,7 @@ const deserializeAws_restJson1DescribeDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7900,7 +7900,7 @@ const deserializeAws_restJson1DescribeDataSourcePermissionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7959,7 +7959,7 @@ const deserializeAws_restJson1DescribeFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8027,7 +8027,7 @@ const deserializeAws_restJson1DescribeFolderPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8095,7 +8095,7 @@ const deserializeAws_restJson1DescribeFolderResolvedPermissionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8157,7 +8157,7 @@ const deserializeAws_restJson1DescribeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8222,7 +8222,7 @@ const deserializeAws_restJson1DescribeGroupMembershipCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8287,7 +8287,7 @@ const deserializeAws_restJson1DescribeIAMPolicyAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8349,7 +8349,7 @@ const deserializeAws_restJson1DescribeIngestionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8417,7 +8417,7 @@ const deserializeAws_restJson1DescribeIpRestrictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8476,7 +8476,7 @@ const deserializeAws_restJson1DescribeNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8538,7 +8538,7 @@ const deserializeAws_restJson1DescribeTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8606,7 +8606,7 @@ const deserializeAws_restJson1DescribeTemplateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8668,7 +8668,7 @@ const deserializeAws_restJson1DescribeTemplatePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8730,7 +8730,7 @@ const deserializeAws_restJson1DescribeThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8795,7 +8795,7 @@ const deserializeAws_restJson1DescribeThemeAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8863,7 +8863,7 @@ const deserializeAws_restJson1DescribeThemePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8925,7 +8925,7 @@ const deserializeAws_restJson1DescribeUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8990,7 +8990,7 @@ const deserializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9058,7 +9058,7 @@ const deserializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9129,7 +9129,7 @@ const deserializeAws_restJson1GetDashboardEmbedUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9209,7 +9209,7 @@ const deserializeAws_restJson1GetSessionEmbedUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9283,7 +9283,7 @@ const deserializeAws_restJson1ListAnalysesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9342,7 +9342,7 @@ const deserializeAws_restJson1ListDashboardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9404,7 +9404,7 @@ const deserializeAws_restJson1ListDashboardVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9469,7 +9469,7 @@ const deserializeAws_restJson1ListDataSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9531,7 +9531,7 @@ const deserializeAws_restJson1ListDataSourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9593,7 +9593,7 @@ const deserializeAws_restJson1ListFolderMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9661,7 +9661,7 @@ const deserializeAws_restJson1ListFoldersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9729,7 +9729,7 @@ const deserializeAws_restJson1ListGroupMembershipsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9800,7 +9800,7 @@ const deserializeAws_restJson1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9874,7 +9874,7 @@ const deserializeAws_restJson1ListIAMPolicyAssignmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9939,7 +9939,7 @@ const deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10007,7 +10007,7 @@ const deserializeAws_restJson1ListIngestionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10075,7 +10075,7 @@ const deserializeAws_restJson1ListNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10143,7 +10143,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10205,7 +10205,7 @@ const deserializeAws_restJson1ListTemplateAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10267,7 +10267,7 @@ const deserializeAws_restJson1ListTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10335,7 +10335,7 @@ const deserializeAws_restJson1ListTemplateVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10400,7 +10400,7 @@ const deserializeAws_restJson1ListThemeAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10468,7 +10468,7 @@ const deserializeAws_restJson1ListThemesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10539,7 +10539,7 @@ const deserializeAws_restJson1ListThemeVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10607,7 +10607,7 @@ const deserializeAws_restJson1ListUserGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10675,7 +10675,7 @@ const deserializeAws_restJson1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10746,7 +10746,7 @@ const deserializeAws_restJson1RegisterUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10820,7 +10820,7 @@ const deserializeAws_restJson1RestoreAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10885,7 +10885,7 @@ const deserializeAws_restJson1SearchAnalysesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10950,7 +10950,7 @@ const deserializeAws_restJson1SearchDashboardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11015,7 +11015,7 @@ const deserializeAws_restJson1SearchFoldersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11083,7 +11083,7 @@ const deserializeAws_restJson1SearchGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11148,7 +11148,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11207,7 +11207,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11275,7 +11275,7 @@ const deserializeAws_restJson1UpdateAccountCustomizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11337,7 +11337,7 @@ const deserializeAws_restJson1UpdateAccountSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11405,7 +11405,7 @@ const deserializeAws_restJson1UpdateAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11476,7 +11476,7 @@ const deserializeAws_restJson1UpdateAnalysisPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11547,7 +11547,7 @@ const deserializeAws_restJson1UpdateDashboardCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11624,7 +11624,7 @@ const deserializeAws_restJson1UpdateDashboardPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11689,7 +11689,7 @@ const deserializeAws_restJson1UpdateDashboardPublishedVersionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11760,7 +11760,7 @@ const deserializeAws_restJson1UpdateDataSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11831,7 +11831,7 @@ const deserializeAws_restJson1UpdateDataSetPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11899,7 +11899,7 @@ const deserializeAws_restJson1UpdateDataSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11964,7 +11964,7 @@ const deserializeAws_restJson1UpdateDataSourcePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12029,7 +12029,7 @@ const deserializeAws_restJson1UpdateFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12103,7 +12103,7 @@ const deserializeAws_restJson1UpdateFolderPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12168,7 +12168,7 @@ const deserializeAws_restJson1UpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12245,7 +12245,7 @@ const deserializeAws_restJson1UpdateIAMPolicyAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12310,7 +12310,7 @@ const deserializeAws_restJson1UpdateIpRestrictionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12369,7 +12369,7 @@ const deserializeAws_restJson1UpdatePublicSharingSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12440,7 +12440,7 @@ const deserializeAws_restJson1UpdateTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12508,7 +12508,7 @@ const deserializeAws_restJson1UpdateTemplateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12573,7 +12573,7 @@ const deserializeAws_restJson1UpdateTemplatePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12644,7 +12644,7 @@ const deserializeAws_restJson1UpdateThemeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12712,7 +12712,7 @@ const deserializeAws_restJson1UpdateThemeAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12783,7 +12783,7 @@ const deserializeAws_restJson1UpdateThemePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12845,7 +12845,7 @@ const deserializeAws_restJson1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -16725,6 +16725,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ram/src/protocols/Aws_restJson1.ts b/clients/client-ram/src/protocols/Aws_restJson1.ts index 8015433720f8..64870443e724 100644 --- a/clients/client-ram/src/protocols/Aws_restJson1.ts +++ b/clients/client-ram/src/protocols/Aws_restJson1.ts @@ -873,7 +873,7 @@ const deserializeAws_restJson1AcceptResourceShareInvitationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -953,7 +953,7 @@ const deserializeAws_restJson1AssociateResourceShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1027,7 +1027,7 @@ const deserializeAws_restJson1AssociateResourceSharePermissionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1089,7 +1089,7 @@ const deserializeAws_restJson1CreateResourceShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1163,7 +1163,7 @@ const deserializeAws_restJson1DeleteResourceShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1234,7 +1234,7 @@ const deserializeAws_restJson1DisassociateResourceShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1305,7 +1305,7 @@ const deserializeAws_restJson1DisassociateResourceSharePermissionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1367,7 +1367,7 @@ const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1414,7 +1414,7 @@ const deserializeAws_restJson1GetPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1473,7 +1473,7 @@ const deserializeAws_restJson1GetResourcePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1535,7 +1535,7 @@ const deserializeAws_restJson1GetResourceShareAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1600,7 +1600,7 @@ const deserializeAws_restJson1GetResourceShareInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1665,7 +1665,7 @@ const deserializeAws_restJson1GetResourceSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1724,7 +1724,7 @@ const deserializeAws_restJson1ListPendingInvitationResourcesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1795,7 +1795,7 @@ const deserializeAws_restJson1ListPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1851,7 +1851,7 @@ const deserializeAws_restJson1ListPermissionVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1913,7 +1913,7 @@ const deserializeAws_restJson1ListPrincipalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1972,7 +1972,7 @@ const deserializeAws_restJson1ListResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2034,7 +2034,7 @@ const deserializeAws_restJson1ListResourceSharePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2096,7 +2096,7 @@ const deserializeAws_restJson1ListResourceTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2146,7 +2146,7 @@ const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2214,7 +2214,7 @@ const deserializeAws_restJson1RejectResourceShareInvitationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2285,7 +2285,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2344,7 +2344,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2394,7 +2394,7 @@ const deserializeAws_restJson1UpdateResourceShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3196,6 +3196,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-rbin/src/protocols/Aws_restJson1.ts b/clients/client-rbin/src/protocols/Aws_restJson1.ts index 7e9b0a9c13e7..2a3b244f1826 100644 --- a/clients/client-rbin/src/protocols/Aws_restJson1.ts +++ b/clients/client-rbin/src/protocols/Aws_restJson1.ts @@ -283,7 +283,7 @@ const deserializeAws_restJson1CreateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -327,7 +327,7 @@ const deserializeAws_restJson1DeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -389,7 +389,7 @@ const deserializeAws_restJson1GetRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -439,7 +439,7 @@ const deserializeAws_restJson1ListRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -483,7 +483,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -527,7 +527,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -574,7 +574,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -636,7 +636,7 @@ const deserializeAws_restJson1UpdateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -873,6 +873,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-rds-data/src/protocols/Aws_restJson1.ts b/clients/client-rds-data/src/protocols/Aws_restJson1.ts index eab6caeb15e5..3e78622ed3b6 100644 --- a/clients/client-rds-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-rds-data/src/protocols/Aws_restJson1.ts @@ -254,7 +254,7 @@ const deserializeAws_restJson1BatchExecuteStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -310,7 +310,7 @@ const deserializeAws_restJson1BeginTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -366,7 +366,7 @@ const deserializeAws_restJson1CommitTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -425,7 +425,7 @@ const deserializeAws_restJson1ExecuteSqlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -490,7 +490,7 @@ const deserializeAws_restJson1ExecuteStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -546,7 +546,7 @@ const deserializeAws_restJson1RollbackTransactionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1140,6 +1140,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-rds/src/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts index 90c5d51e1142..0566a1a2c4b1 100644 --- a/clients/client-rds/src/protocols/Aws_query.ts +++ b/clients/client-rds/src/protocols/Aws_query.ts @@ -3141,7 +3141,7 @@ const deserializeAws_queryAddRoleToDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3188,7 +3188,7 @@ const deserializeAws_queryAddRoleToDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3241,7 +3241,7 @@ const deserializeAws_queryAddSourceIdentifierToSubscriptionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3282,7 +3282,7 @@ const deserializeAws_queryAddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3335,7 +3335,7 @@ const deserializeAws_queryApplyPendingMaintenanceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3385,7 +3385,7 @@ const deserializeAws_queryAuthorizeDBSecurityGroupIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3435,7 +3435,7 @@ const deserializeAws_queryBacktrackDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3479,7 +3479,7 @@ const deserializeAws_queryCancelExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3523,7 +3523,7 @@ const deserializeAws_queryCopyDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3570,7 +3570,7 @@ const deserializeAws_queryCopyDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3626,7 +3626,7 @@ const deserializeAws_queryCopyDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3673,7 +3673,7 @@ const deserializeAws_queryCopyDBSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3729,7 +3729,7 @@ const deserializeAws_queryCopyOptionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3776,7 +3776,7 @@ const deserializeAws_queryCreateCustomDBEngineVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3823,7 +3823,7 @@ const deserializeAws_queryCreateDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3915,7 +3915,7 @@ const deserializeAws_queryCreateDBClusterEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3971,7 +3971,7 @@ const deserializeAws_queryCreateDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4015,7 +4015,7 @@ const deserializeAws_queryCreateDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4068,7 +4068,7 @@ const deserializeAws_queryCreateDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4166,7 +4166,7 @@ const deserializeAws_queryCreateDBInstanceReadReplicaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4264,7 +4264,7 @@ const deserializeAws_queryCreateDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4308,7 +4308,7 @@ const deserializeAws_queryCreateDBProxyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4355,7 +4355,7 @@ const deserializeAws_queryCreateDBProxyEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4408,7 +4408,7 @@ const deserializeAws_queryCreateDBSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4455,7 +4455,7 @@ const deserializeAws_queryCreateDBSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4505,7 +4505,7 @@ const deserializeAws_queryCreateDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4558,7 +4558,7 @@ const deserializeAws_queryCreateEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4617,7 +4617,7 @@ const deserializeAws_queryCreateGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4667,7 +4667,7 @@ const deserializeAws_queryCreateOptionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4711,7 +4711,7 @@ const deserializeAws_queryDeleteCustomDBEngineVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4755,7 +4755,7 @@ const deserializeAws_queryDeleteDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4808,7 +4808,7 @@ const deserializeAws_queryDeleteDBClusterEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4852,7 +4852,7 @@ const deserializeAws_queryDeleteDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4896,7 +4896,7 @@ const deserializeAws_queryDeleteDBClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4940,7 +4940,7 @@ const deserializeAws_queryDeleteDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4999,7 +4999,7 @@ const deserializeAws_queryDeleteDBInstanceAutomatedBackupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5040,7 +5040,7 @@ const deserializeAws_queryDeleteDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5084,7 +5084,7 @@ const deserializeAws_queryDeleteDBProxyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5128,7 +5128,7 @@ const deserializeAws_queryDeleteDBProxyEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5169,7 +5169,7 @@ const deserializeAws_queryDeleteDBSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5213,7 +5213,7 @@ const deserializeAws_queryDeleteDBSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5254,7 +5254,7 @@ const deserializeAws_queryDeleteDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5301,7 +5301,7 @@ const deserializeAws_queryDeleteEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5345,7 +5345,7 @@ const deserializeAws_queryDeleteGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5386,7 +5386,7 @@ const deserializeAws_queryDeleteOptionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5430,7 +5430,7 @@ const deserializeAws_queryDeregisterDBProxyTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5480,7 +5480,7 @@ const deserializeAws_queryDescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5515,7 +5515,7 @@ const deserializeAws_queryDescribeCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5556,7 +5556,7 @@ const deserializeAws_queryDescribeDBClusterBacktracksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5600,7 +5600,7 @@ const deserializeAws_queryDescribeDBClusterEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5641,7 +5641,7 @@ const deserializeAws_queryDescribeDBClusterParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5682,7 +5682,7 @@ const deserializeAws_queryDescribeDBClusterParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5723,7 +5723,7 @@ const deserializeAws_queryDescribeDBClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5767,7 +5767,7 @@ const deserializeAws_queryDescribeDBClusterSnapshotAttributesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5808,7 +5808,7 @@ const deserializeAws_queryDescribeDBClusterSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5849,7 +5849,7 @@ const deserializeAws_queryDescribeDBEngineVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5887,7 +5887,7 @@ const deserializeAws_queryDescribeDBInstanceAutomatedBackupsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5928,7 +5928,7 @@ const deserializeAws_queryDescribeDBInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5969,7 +5969,7 @@ const deserializeAws_queryDescribeDBLogFilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6010,7 +6010,7 @@ const deserializeAws_queryDescribeDBParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6051,7 +6051,7 @@ const deserializeAws_queryDescribeDBParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6092,7 +6092,7 @@ const deserializeAws_queryDescribeDBProxiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6133,7 +6133,7 @@ const deserializeAws_queryDescribeDBProxyEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6177,7 +6177,7 @@ const deserializeAws_queryDescribeDBProxyTargetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6224,7 +6224,7 @@ const deserializeAws_queryDescribeDBProxyTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6274,7 +6274,7 @@ const deserializeAws_queryDescribeDBSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6315,7 +6315,7 @@ const deserializeAws_queryDescribeDBSnapshotAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6356,7 +6356,7 @@ const deserializeAws_queryDescribeDBSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6397,7 +6397,7 @@ const deserializeAws_queryDescribeDBSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6441,7 +6441,7 @@ const deserializeAws_queryDescribeEngineDefaultClusterParametersCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6479,7 +6479,7 @@ const deserializeAws_queryDescribeEngineDefaultParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6514,7 +6514,7 @@ const deserializeAws_queryDescribeEventCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6549,7 +6549,7 @@ const deserializeAws_queryDescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6584,7 +6584,7 @@ const deserializeAws_queryDescribeEventSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6625,7 +6625,7 @@ const deserializeAws_queryDescribeExportTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6666,7 +6666,7 @@ const deserializeAws_queryDescribeGlobalClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6707,7 +6707,7 @@ const deserializeAws_queryDescribeOptionGroupOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6742,7 +6742,7 @@ const deserializeAws_queryDescribeOptionGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6786,7 +6786,7 @@ const deserializeAws_queryDescribeOrderableDBInstanceOptionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6824,7 +6824,7 @@ const deserializeAws_queryDescribePendingMaintenanceActionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6865,7 +6865,7 @@ const deserializeAws_queryDescribeReservedDBInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6909,7 +6909,7 @@ const deserializeAws_queryDescribeReservedDBInstancesOfferingsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6950,7 +6950,7 @@ const deserializeAws_queryDescribeSourceRegionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6988,7 +6988,7 @@ const deserializeAws_queryDescribeValidDBInstanceModificationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7032,7 +7032,7 @@ const deserializeAws_queryDownloadDBLogFilePortionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7076,7 +7076,7 @@ const deserializeAws_queryFailoverDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7123,7 +7123,7 @@ const deserializeAws_queryFailoverGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7173,7 +7173,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7226,7 +7226,7 @@ const deserializeAws_queryModifyActivityStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7273,7 +7273,7 @@ const deserializeAws_queryModifyCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7314,7 +7314,7 @@ const deserializeAws_queryModifyCurrentDBClusterCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7361,7 +7361,7 @@ const deserializeAws_queryModifyCustomDBEngineVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7405,7 +7405,7 @@ const deserializeAws_queryModifyDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7479,7 +7479,7 @@ const deserializeAws_queryModifyDBClusterEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7532,7 +7532,7 @@ const deserializeAws_queryModifyDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7579,7 +7579,7 @@ const deserializeAws_queryModifyDBClusterSnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7626,7 +7626,7 @@ const deserializeAws_queryModifyDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7724,7 +7724,7 @@ const deserializeAws_queryModifyDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7768,7 +7768,7 @@ const deserializeAws_queryModifyDBProxyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7815,7 +7815,7 @@ const deserializeAws_queryModifyDBProxyEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7865,7 +7865,7 @@ const deserializeAws_queryModifyDBProxyTargetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7912,7 +7912,7 @@ const deserializeAws_queryModifyDBSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7953,7 +7953,7 @@ const deserializeAws_queryModifyDBSnapshotAttributeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8000,7 +8000,7 @@ const deserializeAws_queryModifyDBSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8053,7 +8053,7 @@ const deserializeAws_queryModifyEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8109,7 +8109,7 @@ const deserializeAws_queryModifyGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8159,7 +8159,7 @@ const deserializeAws_queryModifyOptionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8203,7 +8203,7 @@ const deserializeAws_queryPromoteReadReplicaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8247,7 +8247,7 @@ const deserializeAws_queryPromoteReadReplicaDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8294,7 +8294,7 @@ const deserializeAws_queryPurchaseReservedDBInstancesOfferingCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8341,7 +8341,7 @@ const deserializeAws_queryRebootDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8388,7 +8388,7 @@ const deserializeAws_queryRebootDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8432,7 +8432,7 @@ const deserializeAws_queryRegisterDBProxyTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8497,7 +8497,7 @@ const deserializeAws_queryRemoveFromGlobalClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8541,7 +8541,7 @@ const deserializeAws_queryRemoveRoleFromDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8585,7 +8585,7 @@ const deserializeAws_queryRemoveRoleFromDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8635,7 +8635,7 @@ const deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8676,7 +8676,7 @@ const deserializeAws_queryRemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8729,7 +8729,7 @@ const deserializeAws_queryResetDBClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8773,7 +8773,7 @@ const deserializeAws_queryResetDBParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8817,7 +8817,7 @@ const deserializeAws_queryRestoreDBClusterFromS3CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8897,7 +8897,7 @@ const deserializeAws_queryRestoreDBClusterFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8986,7 +8986,7 @@ const deserializeAws_queryRestoreDBClusterToPointInTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9081,7 +9081,7 @@ const deserializeAws_queryRestoreDBInstanceFromDBSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9182,7 +9182,7 @@ const deserializeAws_queryRestoreDBInstanceFromS3CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9277,7 +9277,7 @@ const deserializeAws_queryRestoreDBInstanceToPointInTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9384,7 +9384,7 @@ const deserializeAws_queryRevokeDBSecurityGroupIngressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9431,7 +9431,7 @@ const deserializeAws_queryStartActivityStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9487,7 +9487,7 @@ const deserializeAws_queryStartDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9534,7 +9534,7 @@ const deserializeAws_queryStartDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9608,7 +9608,7 @@ const deserializeAws_queryStartDBInstanceAutomatedBackupsReplicationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9661,7 +9661,7 @@ const deserializeAws_queryStartExportTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9726,7 +9726,7 @@ const deserializeAws_queryStopActivityStreamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9779,7 +9779,7 @@ const deserializeAws_queryStopDBClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9826,7 +9826,7 @@ const deserializeAws_queryStopDBInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9882,7 +9882,7 @@ const deserializeAws_queryStopDBInstanceAutomatedBackupsReplicationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9926,7 +9926,7 @@ const deserializeAws_querySwitchoverReadReplicaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -24120,6 +24120,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts index 5a00a5b7f6b6..90242a565687 100644 --- a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts @@ -223,7 +223,7 @@ const deserializeAws_json1_1BatchExecuteStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -270,7 +270,7 @@ const deserializeAws_json1_1CancelStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -320,7 +320,7 @@ const deserializeAws_json1_1DescribeStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -367,7 +367,7 @@ const deserializeAws_json1_1DescribeTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -414,7 +414,7 @@ const deserializeAws_json1_1ExecuteStatementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -461,7 +461,7 @@ const deserializeAws_json1_1GetStatementResultCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -508,7 +508,7 @@ const deserializeAws_json1_1ListDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -555,7 +555,7 @@ const deserializeAws_json1_1ListSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -602,7 +602,7 @@ const deserializeAws_json1_1ListStatementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -646,7 +646,7 @@ const deserializeAws_json1_1ListTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1370,6 +1370,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts index 9d7d952ac9f2..5596f6a8d58c 100644 --- a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts @@ -687,7 +687,7 @@ const deserializeAws_json1_1ConvertRecoveryPointToSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -740,7 +740,7 @@ const deserializeAws_json1_1CreateEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -796,7 +796,7 @@ const deserializeAws_json1_1CreateNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -846,7 +846,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -899,7 +899,7 @@ const deserializeAws_json1_1CreateUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -952,7 +952,7 @@ const deserializeAws_json1_1CreateWorkgroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1008,7 +1008,7 @@ const deserializeAws_json1_1DeleteEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1058,7 +1058,7 @@ const deserializeAws_json1_1DeleteNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1108,7 +1108,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1155,7 +1155,7 @@ const deserializeAws_json1_1DeleteSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1205,7 +1205,7 @@ const deserializeAws_json1_1DeleteUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1255,7 +1255,7 @@ const deserializeAws_json1_1DeleteWorkgroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1305,7 +1305,7 @@ const deserializeAws_json1_1GetCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1352,7 +1352,7 @@ const deserializeAws_json1_1GetEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1402,7 +1402,7 @@ const deserializeAws_json1_1GetNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1449,7 +1449,7 @@ const deserializeAws_json1_1GetRecoveryPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1499,7 +1499,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1546,7 +1546,7 @@ const deserializeAws_json1_1GetSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1593,7 +1593,7 @@ const deserializeAws_json1_1GetUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1643,7 +1643,7 @@ const deserializeAws_json1_1GetWorkgroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1690,7 +1690,7 @@ const deserializeAws_json1_1ListEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_json1_1ListNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1784,7 +1784,7 @@ const deserializeAws_json1_1ListRecoveryPointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1828,7 +1828,7 @@ const deserializeAws_json1_1ListSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1875,7 +1875,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1925,7 +1925,7 @@ const deserializeAws_json1_1ListUsageLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1978,7 +1978,7 @@ const deserializeAws_json1_1ListWorkgroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2022,7 +2022,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2075,7 +2075,7 @@ const deserializeAws_json1_1RestoreFromRecoveryPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2125,7 +2125,7 @@ const deserializeAws_json1_1RestoreFromSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2178,7 +2178,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2231,7 +2231,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2281,7 +2281,7 @@ const deserializeAws_json1_1UpdateEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2334,7 +2334,7 @@ const deserializeAws_json1_1UpdateNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,7 +2384,7 @@ const deserializeAws_json1_1UpdateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2434,7 +2434,7 @@ const deserializeAws_json1_1UpdateUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2484,7 +2484,7 @@ const deserializeAws_json1_1UpdateWorkgroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3897,6 +3897,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-redshift/src/protocols/Aws_query.ts b/clients/client-redshift/src/protocols/Aws_query.ts index dbd27b50d2c1..6e7548e7897d 100644 --- a/clients/client-redshift/src/protocols/Aws_query.ts +++ b/clients/client-redshift/src/protocols/Aws_query.ts @@ -2750,7 +2750,7 @@ const deserializeAws_queryAcceptReservedNodeExchangeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2809,7 +2809,7 @@ const deserializeAws_queryAddPartnerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2856,7 +2856,7 @@ const deserializeAws_queryAssociateDataShareConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2903,7 +2903,7 @@ const deserializeAws_queryAuthorizeClusterSecurityGroupIngressCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2953,7 +2953,7 @@ const deserializeAws_queryAuthorizeDataShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2994,7 +2994,7 @@ const deserializeAws_queryAuthorizeEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3050,7 +3050,7 @@ const deserializeAws_queryAuthorizeSnapshotAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3109,7 +3109,7 @@ const deserializeAws_queryBatchDeleteClusterSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3153,7 +3153,7 @@ const deserializeAws_queryBatchModifyClusterSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3197,7 +3197,7 @@ const deserializeAws_queryCancelResizeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3247,7 +3247,7 @@ const deserializeAws_queryCopyClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3300,7 +3300,7 @@ const deserializeAws_queryCreateAuthenticationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3347,7 +3347,7 @@ const deserializeAws_queryCreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3451,7 +3451,7 @@ const deserializeAws_queryCreateClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3501,7 +3501,7 @@ const deserializeAws_queryCreateClusterSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3551,7 +3551,7 @@ const deserializeAws_queryCreateClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3610,7 +3610,7 @@ const deserializeAws_queryCreateClusterSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3672,7 +3672,7 @@ const deserializeAws_queryCreateEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3740,7 +3740,7 @@ const deserializeAws_queryCreateEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3811,7 +3811,7 @@ const deserializeAws_queryCreateHsmClientCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3861,7 +3861,7 @@ const deserializeAws_queryCreateHsmConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3911,7 +3911,7 @@ const deserializeAws_queryCreateScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3967,7 +3967,7 @@ const deserializeAws_queryCreateSnapshotCopyGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4023,7 +4023,7 @@ const deserializeAws_queryCreateSnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4076,7 +4076,7 @@ const deserializeAws_queryCreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4126,7 +4126,7 @@ const deserializeAws_queryCreateUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4185,7 +4185,7 @@ const deserializeAws_queryDeauthorizeDataShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4226,7 +4226,7 @@ const deserializeAws_queryDeleteAuthenticationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4270,7 +4270,7 @@ const deserializeAws_queryDeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4320,7 +4320,7 @@ const deserializeAws_queryDeleteClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4361,7 +4361,7 @@ const deserializeAws_queryDeleteClusterSecurityGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4405,7 +4405,7 @@ const deserializeAws_queryDeleteClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4446,7 +4446,7 @@ const deserializeAws_queryDeleteClusterSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4493,7 +4493,7 @@ const deserializeAws_queryDeleteEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4543,7 +4543,7 @@ const deserializeAws_queryDeleteEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4584,7 +4584,7 @@ const deserializeAws_queryDeleteHsmClientCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4625,7 +4625,7 @@ const deserializeAws_queryDeleteHsmConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4669,7 +4669,7 @@ const deserializeAws_queryDeletePartnerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4713,7 +4713,7 @@ const deserializeAws_queryDeleteScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4754,7 +4754,7 @@ const deserializeAws_queryDeleteSnapshotCopyGrantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4795,7 +4795,7 @@ const deserializeAws_queryDeleteSnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4836,7 +4836,7 @@ const deserializeAws_queryDeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4877,7 +4877,7 @@ const deserializeAws_queryDeleteUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4921,7 +4921,7 @@ const deserializeAws_queryDescribeAccountAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4959,7 +4959,7 @@ const deserializeAws_queryDescribeAuthenticationProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5003,7 +5003,7 @@ const deserializeAws_queryDescribeClusterDbRevisionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5047,7 +5047,7 @@ const deserializeAws_queryDescribeClusterParameterGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5091,7 +5091,7 @@ const deserializeAws_queryDescribeClusterParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5132,7 +5132,7 @@ const deserializeAws_queryDescribeClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5176,7 +5176,7 @@ const deserializeAws_queryDescribeClusterSecurityGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5220,7 +5220,7 @@ const deserializeAws_queryDescribeClusterSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5270,7 +5270,7 @@ const deserializeAws_queryDescribeClusterSubnetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5314,7 +5314,7 @@ const deserializeAws_queryDescribeClusterTracksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5358,7 +5358,7 @@ const deserializeAws_queryDescribeClusterVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5393,7 +5393,7 @@ const deserializeAws_queryDescribeDataSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5434,7 +5434,7 @@ const deserializeAws_queryDescribeDataSharesForConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5475,7 +5475,7 @@ const deserializeAws_queryDescribeDataSharesForProducerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5519,7 +5519,7 @@ const deserializeAws_queryDescribeDefaultClusterParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5554,7 +5554,7 @@ const deserializeAws_queryDescribeEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5601,7 +5601,7 @@ const deserializeAws_queryDescribeEndpointAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5645,7 +5645,7 @@ const deserializeAws_queryDescribeEventCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5680,7 +5680,7 @@ const deserializeAws_queryDescribeEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5715,7 +5715,7 @@ const deserializeAws_queryDescribeEventSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5759,7 +5759,7 @@ const deserializeAws_queryDescribeHsmClientCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5803,7 +5803,7 @@ const deserializeAws_queryDescribeHsmConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5847,7 +5847,7 @@ const deserializeAws_queryDescribeLoggingStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5888,7 +5888,7 @@ const deserializeAws_queryDescribeNodeConfigurationOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5941,7 +5941,7 @@ const deserializeAws_queryDescribeOrderableClusterOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5976,7 +5976,7 @@ const deserializeAws_queryDescribePartnersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6023,7 +6023,7 @@ const deserializeAws_queryDescribeReservedNodeExchangeStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6070,7 +6070,7 @@ const deserializeAws_queryDescribeReservedNodeOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6117,7 +6117,7 @@ const deserializeAws_queryDescribeReservedNodesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6161,7 +6161,7 @@ const deserializeAws_queryDescribeResizeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6205,7 +6205,7 @@ const deserializeAws_queryDescribeScheduledActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6249,7 +6249,7 @@ const deserializeAws_queryDescribeSnapshotCopyGrantsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6293,7 +6293,7 @@ const deserializeAws_queryDescribeSnapshotSchedulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6328,7 +6328,7 @@ const deserializeAws_queryDescribeStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6363,7 +6363,7 @@ const deserializeAws_queryDescribeTableRestoreStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6407,7 +6407,7 @@ const deserializeAws_queryDescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6451,7 +6451,7 @@ const deserializeAws_queryDescribeUsageLimitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6495,7 +6495,7 @@ const deserializeAws_queryDisableLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6539,7 +6539,7 @@ const deserializeAws_queryDisableSnapshotCopyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6589,7 +6589,7 @@ const deserializeAws_queryDisassociateDataShareConsumerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6633,7 +6633,7 @@ const deserializeAws_queryEnableLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6689,7 +6689,7 @@ const deserializeAws_queryEnableSnapshotCopyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6760,7 +6760,7 @@ const deserializeAws_queryGetClusterCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6804,7 +6804,7 @@ const deserializeAws_queryGetClusterCredentialsWithIAMCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6851,7 +6851,7 @@ const deserializeAws_queryGetReservedNodeExchangeConfigurationOptionsCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6916,7 +6916,7 @@ const deserializeAws_queryGetReservedNodeExchangeOfferingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6972,7 +6972,7 @@ const deserializeAws_queryModifyAquaConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7019,7 +7019,7 @@ const deserializeAws_queryModifyAuthenticationProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7066,7 +7066,7 @@ const deserializeAws_queryModifyClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7161,7 +7161,7 @@ const deserializeAws_queryModifyClusterDbRevisionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7208,7 +7208,7 @@ const deserializeAws_queryModifyClusterIamRolesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7252,7 +7252,7 @@ const deserializeAws_queryModifyClusterMaintenanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7296,7 +7296,7 @@ const deserializeAws_queryModifyClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7340,7 +7340,7 @@ const deserializeAws_queryModifyClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7384,7 +7384,7 @@ const deserializeAws_queryModifyClusterSnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7431,7 +7431,7 @@ const deserializeAws_queryModifyClusterSubnetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7487,7 +7487,7 @@ const deserializeAws_queryModifyEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7543,7 +7543,7 @@ const deserializeAws_queryModifyEventSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7608,7 +7608,7 @@ const deserializeAws_queryModifyScheduledActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7664,7 +7664,7 @@ const deserializeAws_queryModifySnapshotCopyRetentionPeriodCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7717,7 +7717,7 @@ const deserializeAws_queryModifySnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7764,7 +7764,7 @@ const deserializeAws_queryModifyUsageLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7811,7 +7811,7 @@ const deserializeAws_queryPauseClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7855,7 +7855,7 @@ const deserializeAws_queryPurchaseReservedNodeOfferingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7905,7 +7905,7 @@ const deserializeAws_queryRebootClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7949,7 +7949,7 @@ const deserializeAws_queryRejectDataShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7990,7 +7990,7 @@ const deserializeAws_queryResetClusterParameterGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8034,7 +8034,7 @@ const deserializeAws_queryResizeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8117,7 +8117,7 @@ const deserializeAws_queryRestoreFromClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8254,7 +8254,7 @@ const deserializeAws_queryRestoreTableFromClusterSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8313,7 +8313,7 @@ const deserializeAws_queryResumeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8363,7 +8363,7 @@ const deserializeAws_queryRevokeClusterSecurityGroupIngressCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8410,7 +8410,7 @@ const deserializeAws_queryRevokeEndpointAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8469,7 +8469,7 @@ const deserializeAws_queryRevokeSnapshotAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8519,7 +8519,7 @@ const deserializeAws_queryRotateEncryptionKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8566,7 +8566,7 @@ const deserializeAws_queryUpdatePartnerStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -19413,6 +19413,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-rekognition/src/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts index df603057a47f..d060cfc7e800 100644 --- a/clients/client-rekognition/src/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/src/protocols/Aws_json1_1.ts @@ -1268,7 +1268,7 @@ const deserializeAws_json1_1CompareFacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1330,7 +1330,7 @@ const deserializeAws_json1_1CopyProjectVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1395,7 +1395,7 @@ const deserializeAws_json1_1CreateCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1454,7 +1454,7 @@ const deserializeAws_json1_1CreateDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1519,7 +1519,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1578,7 +1578,7 @@ const deserializeAws_json1_1CreateProjectVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1643,7 +1643,7 @@ const deserializeAws_json1_1CreateStreamProcessorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1705,7 +1705,7 @@ const deserializeAws_json1_1DeleteCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1761,7 +1761,7 @@ const deserializeAws_json1_1DeleteDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1823,7 +1823,7 @@ const deserializeAws_json1_1DeleteFacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1879,7 +1879,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1938,7 +1938,7 @@ const deserializeAws_json1_1DeleteProjectPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1997,7 +1997,7 @@ const deserializeAws_json1_1DeleteProjectVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2056,7 +2056,7 @@ const deserializeAws_json1_1DeleteStreamProcessorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2115,7 +2115,7 @@ const deserializeAws_json1_1DescribeCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2171,7 +2171,7 @@ const deserializeAws_json1_1DescribeDatasetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2227,7 +2227,7 @@ const deserializeAws_json1_1DescribeProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2283,7 +2283,7 @@ const deserializeAws_json1_1DescribeProjectVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2342,7 +2342,7 @@ const deserializeAws_json1_1DescribeStreamProcessorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2398,7 +2398,7 @@ const deserializeAws_json1_1DetectCustomLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2469,7 +2469,7 @@ const deserializeAws_json1_1DetectFacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2531,7 +2531,7 @@ const deserializeAws_json1_1DetectLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2593,7 +2593,7 @@ const deserializeAws_json1_1DetectModerationLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2658,7 +2658,7 @@ const deserializeAws_json1_1DetectProtectiveEquipmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2720,7 +2720,7 @@ const deserializeAws_json1_1DetectTextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2782,7 +2782,7 @@ const deserializeAws_json1_1DistributeDatasetEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2841,7 +2841,7 @@ const deserializeAws_json1_1GetCelebrityInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2897,7 +2897,7 @@ const deserializeAws_json1_1GetCelebrityRecognitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2956,7 +2956,7 @@ const deserializeAws_json1_1GetContentModerationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3015,7 +3015,7 @@ const deserializeAws_json1_1GetFaceDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3074,7 +3074,7 @@ const deserializeAws_json1_1GetFaceSearchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3133,7 +3133,7 @@ const deserializeAws_json1_1GetLabelDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3192,7 +3192,7 @@ const deserializeAws_json1_1GetPersonTrackingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3251,7 +3251,7 @@ const deserializeAws_json1_1GetSegmentDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3310,7 +3310,7 @@ const deserializeAws_json1_1GetTextDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3369,7 +3369,7 @@ const deserializeAws_json1_1IndexFacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3437,7 +3437,7 @@ const deserializeAws_json1_1ListCollectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3496,7 +3496,7 @@ const deserializeAws_json1_1ListDatasetEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3561,7 +3561,7 @@ const deserializeAws_json1_1ListDatasetLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3626,7 +3626,7 @@ const deserializeAws_json1_1ListFacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3685,7 +3685,7 @@ const deserializeAws_json1_1ListProjectPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3744,7 +3744,7 @@ const deserializeAws_json1_1ListStreamProcessorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3800,7 +3800,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3856,7 +3856,7 @@ const deserializeAws_json1_1PutProjectPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3927,7 +3927,7 @@ const deserializeAws_json1_1RecognizeCelebritiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3989,7 +3989,7 @@ const deserializeAws_json1_1SearchFacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4045,7 +4045,7 @@ const deserializeAws_json1_1SearchFacesByImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4110,7 +4110,7 @@ const deserializeAws_json1_1StartCelebrityRecognitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4175,7 +4175,7 @@ const deserializeAws_json1_1StartContentModerationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4240,7 +4240,7 @@ const deserializeAws_json1_1StartFaceDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4305,7 +4305,7 @@ const deserializeAws_json1_1StartFaceSearchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4373,7 +4373,7 @@ const deserializeAws_json1_1StartLabelDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4438,7 +4438,7 @@ const deserializeAws_json1_1StartPersonTrackingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4503,7 +4503,7 @@ const deserializeAws_json1_1StartProjectVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4565,7 +4565,7 @@ const deserializeAws_json1_1StartSegmentDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4630,7 +4630,7 @@ const deserializeAws_json1_1StartStreamProcessorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4689,7 +4689,7 @@ const deserializeAws_json1_1StartTextDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4754,7 +4754,7 @@ const deserializeAws_json1_1StopProjectVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4813,7 +4813,7 @@ const deserializeAws_json1_1StopStreamProcessorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4872,7 +4872,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4931,7 +4931,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4987,7 +4987,7 @@ const deserializeAws_json1_1UpdateDatasetEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5049,7 +5049,7 @@ const deserializeAws_json1_1UpdateStreamProcessorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8870,6 +8870,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts index 1baf32f7e990..0326bcc5f115 100644 --- a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts +++ b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts @@ -1285,7 +1285,7 @@ const deserializeAws_restJson1AddDraftAppVersionResourceMappingsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1341,7 +1341,7 @@ const deserializeAws_restJson1CreateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1403,7 +1403,7 @@ const deserializeAws_restJson1CreateRecommendationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1459,7 +1459,7 @@ const deserializeAws_restJson1CreateResiliencyPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1515,7 +1515,7 @@ const deserializeAws_restJson1DeleteAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1571,7 +1571,7 @@ const deserializeAws_restJson1DeleteAppAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1630,7 +1630,7 @@ const deserializeAws_restJson1DeleteRecommendationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1683,7 +1683,7 @@ const deserializeAws_restJson1DeleteResiliencyPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1739,7 +1739,7 @@ const deserializeAws_restJson1DescribeAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1792,7 +1792,7 @@ const deserializeAws_restJson1DescribeAppAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1857,7 +1857,7 @@ const deserializeAws_restJson1DescribeAppVersionResourcesResolutionStatusCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1916,7 +1916,7 @@ const deserializeAws_restJson1DescribeAppVersionTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1981,7 +1981,7 @@ const deserializeAws_restJson1DescribeDraftAppVersionResourcesImportStatusComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2034,7 +2034,7 @@ const deserializeAws_restJson1DescribeResiliencyPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2099,7 +2099,7 @@ const deserializeAws_restJson1ImportResourcesToDraftAppVersionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2158,7 +2158,7 @@ const deserializeAws_restJson1ListAlarmRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2214,7 +2214,7 @@ const deserializeAws_restJson1ListAppAssessmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2273,7 +2273,7 @@ const deserializeAws_restJson1ListAppComponentCompliancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2332,7 +2332,7 @@ const deserializeAws_restJson1ListAppComponentRecommendationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2388,7 +2388,7 @@ const deserializeAws_restJson1ListAppsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2441,7 +2441,7 @@ const deserializeAws_restJson1ListAppVersionResourceMappingsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2500,7 +2500,7 @@ const deserializeAws_restJson1ListAppVersionResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2559,7 +2559,7 @@ const deserializeAws_restJson1ListAppVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2615,7 +2615,7 @@ const deserializeAws_restJson1ListRecommendationTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2668,7 +2668,7 @@ const deserializeAws_restJson1ListResiliencyPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2724,7 +2724,7 @@ const deserializeAws_restJson1ListSopRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2783,7 +2783,7 @@ const deserializeAws_restJson1ListSuggestedResiliencyPoliciesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2892,7 +2892,7 @@ const deserializeAws_restJson1ListTestRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2954,7 +2954,7 @@ const deserializeAws_restJson1ListUnsupportedAppVersionResourcesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3013,7 +3013,7 @@ const deserializeAws_restJson1PublishAppVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3072,7 +3072,7 @@ const deserializeAws_restJson1PutDraftAppVersionTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3131,7 +3131,7 @@ const deserializeAws_restJson1RemoveDraftAppVersionResourceMappingsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3196,7 +3196,7 @@ const deserializeAws_restJson1ResolveAppVersionResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3252,7 +3252,7 @@ const deserializeAws_restJson1StartAppAssessmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3308,7 +3308,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3358,7 +3358,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3411,7 +3411,7 @@ const deserializeAws_restJson1UpdateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3467,7 +3467,7 @@ const deserializeAws_restJson1UpdateResiliencyPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4573,6 +4573,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts index a320a050ae06..aa54943b0aca 100644 --- a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts +++ b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts @@ -192,7 +192,7 @@ const deserializeAws_json1_1DescribeReportCreationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -242,7 +242,7 @@ const deserializeAws_json1_1GetComplianceSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -292,7 +292,7 @@ const deserializeAws_json1_1GetResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -342,7 +342,7 @@ const deserializeAws_json1_1GetTagKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -392,7 +392,7 @@ const deserializeAws_json1_1GetTagValuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -442,7 +442,7 @@ const deserializeAws_json1_1StartReportCreationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -495,7 +495,7 @@ const deserializeAws_json1_1TagResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -542,7 +542,7 @@ const deserializeAws_json1_1UntagResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1130,6 +1130,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts index ef8639507a72..d4399479d912 100644 --- a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts @@ -519,7 +519,7 @@ const deserializeAws_restJson1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -572,7 +572,7 @@ const deserializeAws_restJson1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -628,7 +628,7 @@ const deserializeAws_restJson1GetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -684,7 +684,7 @@ const deserializeAws_restJson1GetGroupConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -740,7 +740,7 @@ const deserializeAws_restJson1GetGroupQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -799,7 +799,7 @@ const deserializeAws_restJson1GetTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -861,7 +861,7 @@ const deserializeAws_restJson1GroupResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -926,7 +926,7 @@ const deserializeAws_restJson1ListGroupResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -991,7 +991,7 @@ const deserializeAws_restJson1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1041,7 +1041,7 @@ const deserializeAws_restJson1PutGroupConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1103,7 +1103,7 @@ const deserializeAws_restJson1SearchResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1162,7 +1162,7 @@ const deserializeAws_restJson1TagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1224,7 +1224,7 @@ const deserializeAws_restJson1UngroupResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1283,7 +1283,7 @@ const deserializeAws_restJson1UntagCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1339,7 +1339,7 @@ const deserializeAws_restJson1UpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1395,7 +1395,7 @@ const deserializeAws_restJson1UpdateGroupQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1989,6 +1989,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-robomaker/src/protocols/Aws_restJson1.ts b/clients/client-robomaker/src/protocols/Aws_restJson1.ts index 5e6497de277c..34b034d868ec 100644 --- a/clients/client-robomaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-robomaker/src/protocols/Aws_restJson1.ts @@ -1805,7 +1805,7 @@ const deserializeAws_restJson1BatchDeleteWorldsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1855,7 +1855,7 @@ const deserializeAws_restJson1BatchDescribeSimulationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1902,7 +1902,7 @@ const deserializeAws_restJson1CancelDeploymentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1949,7 +1949,7 @@ const deserializeAws_restJson1CancelSimulationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1996,7 +1996,7 @@ const deserializeAws_restJson1CancelSimulationJobBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2043,7 +2043,7 @@ const deserializeAws_restJson1CancelWorldExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2090,7 +2090,7 @@ const deserializeAws_restJson1CancelWorldGenerationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2167,7 +2167,7 @@ const deserializeAws_restJson1CreateDeploymentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2235,7 +2235,7 @@ const deserializeAws_restJson1CreateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2300,7 +2300,7 @@ const deserializeAws_restJson1CreateRobotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2377,7 +2377,7 @@ const deserializeAws_restJson1CreateRobotApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2454,7 +2454,7 @@ const deserializeAws_restJson1CreateRobotApplicationVersionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2540,7 +2540,7 @@ const deserializeAws_restJson1CreateSimulationApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2626,7 +2626,7 @@ const deserializeAws_restJson1CreateSimulationApplicationVersionCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2733,7 +2733,7 @@ const deserializeAws_restJson1CreateSimulationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2813,7 +2813,7 @@ const deserializeAws_restJson1CreateWorldExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2893,7 +2893,7 @@ const deserializeAws_restJson1CreateWorldGenerationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2964,7 +2964,7 @@ const deserializeAws_restJson1CreateWorldTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3017,7 +3017,7 @@ const deserializeAws_restJson1DeleteFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3061,7 +3061,7 @@ const deserializeAws_restJson1DeleteRobotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3105,7 +3105,7 @@ const deserializeAws_restJson1DeleteRobotApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3149,7 +3149,7 @@ const deserializeAws_restJson1DeleteSimulationApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3193,7 +3193,7 @@ const deserializeAws_restJson1DeleteWorldTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3246,7 +3246,7 @@ const deserializeAws_restJson1DeregisterRobotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3329,7 +3329,7 @@ const deserializeAws_restJson1DescribeDeploymentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3400,7 +3400,7 @@ const deserializeAws_restJson1DescribeFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3477,7 +3477,7 @@ const deserializeAws_restJson1DescribeRobotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3554,7 +3554,7 @@ const deserializeAws_restJson1DescribeRobotApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3640,7 +3640,7 @@ const deserializeAws_restJson1DescribeSimulationApplicationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3753,7 +3753,7 @@ const deserializeAws_restJson1DescribeSimulationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3836,7 +3836,7 @@ const deserializeAws_restJson1DescribeSimulationJobBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3898,7 +3898,7 @@ const deserializeAws_restJson1DescribeWorldCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3975,7 +3975,7 @@ const deserializeAws_restJson1DescribeWorldExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4055,7 +4055,7 @@ const deserializeAws_restJson1DescribeWorldGenerationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4123,7 +4123,7 @@ const deserializeAws_restJson1DescribeWorldTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4173,7 +4173,7 @@ const deserializeAws_restJson1GetWorldTemplateBodyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4226,7 +4226,7 @@ const deserializeAws_restJson1ListDeploymentJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4279,7 +4279,7 @@ const deserializeAws_restJson1ListFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4335,7 +4335,7 @@ const deserializeAws_restJson1ListRobotApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4385,7 +4385,7 @@ const deserializeAws_restJson1ListRobotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4441,7 +4441,7 @@ const deserializeAws_restJson1ListSimulationApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4494,7 +4494,7 @@ const deserializeAws_restJson1ListSimulationJobBatchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4544,7 +4544,7 @@ const deserializeAws_restJson1ListSimulationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4591,7 +4591,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4647,7 +4647,7 @@ const deserializeAws_restJson1ListWorldExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4700,7 +4700,7 @@ const deserializeAws_restJson1ListWorldGenerationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4750,7 +4750,7 @@ const deserializeAws_restJson1ListWorldsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4800,7 +4800,7 @@ const deserializeAws_restJson1ListWorldTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4850,7 +4850,7 @@ const deserializeAws_restJson1RegisterRobotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4900,7 +4900,7 @@ const deserializeAws_restJson1RestartSimulationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4983,7 +4983,7 @@ const deserializeAws_restJson1StartSimulationJobBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5060,7 +5060,7 @@ const deserializeAws_restJson1SyncDeploymentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5116,7 +5116,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5163,7 +5163,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5234,7 +5234,7 @@ const deserializeAws_restJson1UpdateRobotApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5317,7 +5317,7 @@ const deserializeAws_restJson1UpdateSimulationApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5379,7 +5379,7 @@ const deserializeAws_restJson1UpdateWorldTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7148,6 +7148,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts index 634f11245288..a80fbae72640 100644 --- a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts +++ b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts @@ -732,7 +732,7 @@ const deserializeAws_restJson1CreateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -776,7 +776,7 @@ const deserializeAws_restJson1CreateTrustAnchorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -820,7 +820,7 @@ const deserializeAws_restJson1DeleteCrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -864,7 +864,7 @@ const deserializeAws_restJson1DeleteProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -908,7 +908,7 @@ const deserializeAws_restJson1DeleteTrustAnchorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -952,7 +952,7 @@ const deserializeAws_restJson1DisableCrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -996,7 +996,7 @@ const deserializeAws_restJson1DisableProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1040,7 +1040,7 @@ const deserializeAws_restJson1DisableTrustAnchorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1084,7 +1084,7 @@ const deserializeAws_restJson1EnableCrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1128,7 +1128,7 @@ const deserializeAws_restJson1EnableProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1172,7 +1172,7 @@ const deserializeAws_restJson1EnableTrustAnchorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1216,7 +1216,7 @@ const deserializeAws_restJson1GetCrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1257,7 +1257,7 @@ const deserializeAws_restJson1GetProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1301,7 +1301,7 @@ const deserializeAws_restJson1GetSubjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1345,7 +1345,7 @@ const deserializeAws_restJson1GetTrustAnchorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1392,7 +1392,7 @@ const deserializeAws_restJson1ImportCrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1439,7 +1439,7 @@ const deserializeAws_restJson1ListCrlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1486,7 +1486,7 @@ const deserializeAws_restJson1ListProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1533,7 +1533,7 @@ const deserializeAws_restJson1ListSubjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1577,7 +1577,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1627,7 +1627,7 @@ const deserializeAws_restJson1ListTrustAnchorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1668,7 +1668,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1715,7 +1715,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1762,7 +1762,7 @@ const deserializeAws_restJson1UpdateCrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1809,7 +1809,7 @@ const deserializeAws_restJson1UpdateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1856,7 +1856,7 @@ const deserializeAws_restJson1UpdateTrustAnchorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,6 +2275,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts index 08ce8200ce74..0f1e1ae23331 100644 --- a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts @@ -600,7 +600,7 @@ const deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -650,7 +650,7 @@ const deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -697,7 +697,7 @@ const deserializeAws_json1_1CheckDomainAvailabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -741,7 +741,7 @@ const deserializeAws_json1_1CheckDomainTransferabilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -785,7 +785,7 @@ const deserializeAws_json1_1DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -835,7 +835,7 @@ const deserializeAws_json1_1DeleteTagsForDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -882,7 +882,7 @@ const deserializeAws_json1_1DisableDomainAutoRenewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -926,7 +926,7 @@ const deserializeAws_json1_1DisableDomainTransferLockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -979,7 +979,7 @@ const deserializeAws_json1_1EnableDomainAutoRenewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1026,7 +1026,7 @@ const deserializeAws_json1_1EnableDomainTransferLockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1079,7 +1079,7 @@ const deserializeAws_json1_1GetContactReachabilityStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1126,7 +1126,7 @@ const deserializeAws_json1_1GetDomainDetailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1170,7 +1170,7 @@ const deserializeAws_json1_1GetDomainSuggestionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1214,7 +1214,7 @@ const deserializeAws_json1_1GetOperationDetailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1255,7 +1255,7 @@ const deserializeAws_json1_1ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1296,7 +1296,7 @@ const deserializeAws_json1_1ListOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1337,7 +1337,7 @@ const deserializeAws_json1_1ListPricesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1381,7 +1381,7 @@ const deserializeAws_json1_1ListTagsForDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1428,7 +1428,7 @@ const deserializeAws_json1_1RegisterDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1484,7 +1484,7 @@ const deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_json1_1RenewDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1584,7 +1584,7 @@ const deserializeAws_json1_1ResendContactReachabilityEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1631,7 +1631,7 @@ const deserializeAws_json1_1RetrieveDomainAuthCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1675,7 +1675,7 @@ const deserializeAws_json1_1TransferDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1731,7 +1731,7 @@ const deserializeAws_json1_1TransferDomainToAnotherAwsAccountCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1781,7 +1781,7 @@ const deserializeAws_json1_1UpdateDomainContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1834,7 +1834,7 @@ const deserializeAws_json1_1UpdateDomainContactPrivacyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1887,7 +1887,7 @@ const deserializeAws_json1_1UpdateDomainNameserversCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_json1_1UpdateTagsForDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1ViewBillingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3120,6 +3120,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-route-53/src/protocols/Aws_restXml.ts b/clients/client-route-53/src/protocols/Aws_restXml.ts index ef55a7ba0365..a4eac55d6af8 100644 --- a/clients/client-route-53/src/protocols/Aws_restXml.ts +++ b/clients/client-route-53/src/protocols/Aws_restXml.ts @@ -2566,7 +2566,7 @@ const deserializeAws_restXmlActivateKeySigningKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2622,7 +2622,7 @@ const deserializeAws_restXmlAssociateVPCWithHostedZoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2684,7 +2684,7 @@ const deserializeAws_restXmlChangeCidrCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2740,7 +2740,7 @@ const deserializeAws_restXmlChangeResourceRecordSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2790,7 +2790,7 @@ const deserializeAws_restXmlChangeTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2844,7 +2844,7 @@ const deserializeAws_restXmlCreateCidrCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2895,7 +2895,7 @@ const deserializeAws_restXmlCreateHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2952,7 +2952,7 @@ const deserializeAws_restXmlCreateHostedZoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_restXmlCreateKeySigningKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3090,7 +3090,7 @@ const deserializeAws_restXmlCreateQueryLoggingConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3147,7 +3147,7 @@ const deserializeAws_restXmlCreateReusableDelegationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3207,7 +3207,7 @@ const deserializeAws_restXmlCreateTrafficPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3261,7 +3261,7 @@ const deserializeAws_restXmlCreateTrafficPolicyInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3315,7 +3315,7 @@ const deserializeAws_restXmlCreateTrafficPolicyVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3371,7 +3371,7 @@ const deserializeAws_restXmlCreateVPCAssociationAuthorizationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3424,7 +3424,7 @@ const deserializeAws_restXmlDeactivateKeySigningKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3480,7 +3480,7 @@ const deserializeAws_restXmlDeleteCidrCollectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3527,7 +3527,7 @@ const deserializeAws_restXmlDeleteHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3574,7 +3574,7 @@ const deserializeAws_restXmlDeleteHostedZoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3627,7 +3627,7 @@ const deserializeAws_restXmlDeleteKeySigningKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3680,7 +3680,7 @@ const deserializeAws_restXmlDeleteQueryLoggingConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3724,7 +3724,7 @@ const deserializeAws_restXmlDeleteReusableDelegationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3771,7 +3771,7 @@ const deserializeAws_restXmlDeleteTrafficPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3818,7 +3818,7 @@ const deserializeAws_restXmlDeleteTrafficPolicyInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3862,7 +3862,7 @@ const deserializeAws_restXmlDeleteVPCAssociationAuthorizationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3915,7 +3915,7 @@ const deserializeAws_restXmlDisableHostedZoneDNSSECCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3977,7 +3977,7 @@ const deserializeAws_restXmlDisassociateVPCFromHostedZoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4030,7 +4030,7 @@ const deserializeAws_restXmlEnableHostedZoneDNSSECCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4098,7 +4098,7 @@ const deserializeAws_restXmlGetAccountLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4139,7 +4139,7 @@ const deserializeAws_restXmlGetChangeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4188,7 +4188,7 @@ const deserializeAws_restXmlGetCheckerIpRangesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4231,7 +4231,7 @@ const deserializeAws_restXmlGetDNSSECCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4278,7 +4278,7 @@ const deserializeAws_restXmlGetGeoLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4322,7 +4322,7 @@ const deserializeAws_restXmlGetHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4369,7 +4369,7 @@ const deserializeAws_restXmlGetHealthCheckCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4412,7 +4412,7 @@ const deserializeAws_restXmlGetHealthCheckLastFailureReasonCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4464,7 +4464,7 @@ const deserializeAws_restXmlGetHealthCheckStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4516,7 +4516,7 @@ const deserializeAws_restXmlGetHostedZoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4560,7 +4560,7 @@ const deserializeAws_restXmlGetHostedZoneCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4604,7 +4604,7 @@ const deserializeAws_restXmlGetHostedZoneLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4651,7 +4651,7 @@ const deserializeAws_restXmlGetQueryLoggingConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4695,7 +4695,7 @@ const deserializeAws_restXmlGetReusableDelegationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4745,7 +4745,7 @@ const deserializeAws_restXmlGetReusableDelegationSetLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4789,7 +4789,7 @@ const deserializeAws_restXmlGetTrafficPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4836,7 +4836,7 @@ const deserializeAws_restXmlGetTrafficPolicyInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4880,7 +4880,7 @@ const deserializeAws_restXmlGetTrafficPolicyInstanceCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4923,7 +4923,7 @@ const deserializeAws_restXmlListCidrBlocksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4978,7 +4978,7 @@ const deserializeAws_restXmlListCidrCollectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5027,7 +5027,7 @@ const deserializeAws_restXmlListCidrLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5094,7 +5094,7 @@ const deserializeAws_restXmlListGeoLocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5152,7 +5152,7 @@ const deserializeAws_restXmlListHealthChecksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5213,7 +5213,7 @@ const deserializeAws_restXmlListHostedZonesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5283,7 +5283,7 @@ const deserializeAws_restXmlListHostedZonesByNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5341,7 +5341,7 @@ const deserializeAws_restXmlListHostedZonesByVPCCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5396,7 +5396,7 @@ const deserializeAws_restXmlListQueryLoggingConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5466,7 +5466,7 @@ const deserializeAws_restXmlListResourceRecordSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5527,7 +5527,7 @@ const deserializeAws_restXmlListReusableDelegationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5568,7 +5568,7 @@ const deserializeAws_restXmlListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5626,7 +5626,7 @@ const deserializeAws_restXmlListTagsForResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5696,7 +5696,7 @@ const deserializeAws_restXmlListTrafficPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5760,7 +5760,7 @@ const deserializeAws_restXmlListTrafficPolicyInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5824,7 +5824,7 @@ const deserializeAws_restXmlListTrafficPolicyInstancesByHostedZoneCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5894,7 +5894,7 @@ const deserializeAws_restXmlListTrafficPolicyInstancesByPolicyCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5955,7 +5955,7 @@ const deserializeAws_restXmlListTrafficPolicyVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6007,7 +6007,7 @@ const deserializeAws_restXmlListVPCAssociationAuthorizationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6074,7 +6074,7 @@ const deserializeAws_restXmlTestDNSAnswerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6118,7 +6118,7 @@ const deserializeAws_restXmlUpdateHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6165,7 +6165,7 @@ const deserializeAws_restXmlUpdateHostedZoneCommentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6212,7 +6212,7 @@ const deserializeAws_restXmlUpdateTrafficPolicyCommentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6262,7 +6262,7 @@ const deserializeAws_restXmlUpdateTrafficPolicyInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8968,6 +8968,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const loadRestXmlErrorCode = (output: __HttpResponse, data: any): string | undefined => { if (data.Error.Code !== undefined) { return data.Error.Code; diff --git a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts index a17f54c24680..9459895a085d 100644 --- a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts +++ b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts @@ -127,7 +127,7 @@ const deserializeAws_json1_0GetRoutingControlStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -183,7 +183,7 @@ const deserializeAws_json1_0ListRoutingControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -239,7 +239,7 @@ const deserializeAws_json1_0UpdateRoutingControlStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -298,7 +298,7 @@ const deserializeAws_json1_0UpdateRoutingControlStatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -730,6 +730,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts index aff8ed81b8d0..0e30a81d7fb7 100644 --- a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts @@ -728,7 +728,7 @@ const deserializeAws_restJson1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -787,7 +787,7 @@ const deserializeAws_restJson1CreateControlPanelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -846,7 +846,7 @@ const deserializeAws_restJson1CreateRoutingControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -908,7 +908,7 @@ const deserializeAws_restJson1CreateSafetyRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -949,7 +949,7 @@ const deserializeAws_restJson1DeleteClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1002,7 +1002,7 @@ const deserializeAws_restJson1DeleteControlPanelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1055,7 +1055,7 @@ const deserializeAws_restJson1DeleteRoutingControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1108,7 +1108,7 @@ const deserializeAws_restJson1DeleteSafetyRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1155,7 +1155,7 @@ const deserializeAws_restJson1DescribeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1211,7 +1211,7 @@ const deserializeAws_restJson1DescribeControlPanelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1267,7 +1267,7 @@ const deserializeAws_restJson1DescribeRoutingControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1326,7 +1326,7 @@ const deserializeAws_restJson1DescribeSafetyRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1373,7 +1373,7 @@ const deserializeAws_restJson1ListAssociatedRoute53HealthChecksCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1423,7 +1423,7 @@ const deserializeAws_restJson1ListClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_restJson1ListControlPanelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1535,7 +1535,7 @@ const deserializeAws_restJson1ListRoutingControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1591,7 +1591,7 @@ const deserializeAws_restJson1ListSafetyRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1644,7 +1644,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1688,7 +1688,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1732,7 +1732,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1779,7 +1779,7 @@ const deserializeAws_restJson1UpdateControlPanelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1835,7 +1835,7 @@ const deserializeAws_restJson1UpdateRoutingControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1894,7 +1894,7 @@ const deserializeAws_restJson1UpdateSafetyRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2332,6 +2332,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts index 982d0b31cfbb..440a3d5d921b 100644 --- a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts @@ -1034,7 +1034,7 @@ const deserializeAws_restJson1CreateCellCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1087,7 +1087,7 @@ const deserializeAws_restJson1CreateCrossAccountAuthorizationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1149,7 +1149,7 @@ const deserializeAws_restJson1CreateReadinessCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1211,7 +1211,7 @@ const deserializeAws_restJson1CreateRecoveryGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1276,7 +1276,7 @@ const deserializeAws_restJson1CreateResourceSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1326,7 +1326,7 @@ const deserializeAws_restJson1DeleteCellCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1376,7 +1376,7 @@ const deserializeAws_restJson1DeleteCrossAccountAuthorizationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1423,7 +1423,7 @@ const deserializeAws_restJson1DeleteReadinessCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1473,7 +1473,7 @@ const deserializeAws_restJson1DeleteRecoveryGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1523,7 +1523,7 @@ const deserializeAws_restJson1DeleteResourceSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1582,7 +1582,7 @@ const deserializeAws_restJson1GetArchitectureRecommendationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1647,7 +1647,7 @@ const deserializeAws_restJson1GetCellCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1706,7 +1706,7 @@ const deserializeAws_restJson1GetCellReadinessSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1768,7 +1768,7 @@ const deserializeAws_restJson1GetReadinessCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1827,7 +1827,7 @@ const deserializeAws_restJson1GetReadinessCheckResourceStatusCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1889,7 +1889,7 @@ const deserializeAws_restJson1GetReadinessCheckStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1951,7 +1951,7 @@ const deserializeAws_restJson1GetRecoveryGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2010,7 +2010,7 @@ const deserializeAws_restJson1GetRecoveryGroupReadinessSummaryCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2075,7 +2075,7 @@ const deserializeAws_restJson1GetResourceSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2131,7 +2131,7 @@ const deserializeAws_restJson1ListCellsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2187,7 +2187,7 @@ const deserializeAws_restJson1ListCrossAccountAuthorizationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2240,7 +2240,7 @@ const deserializeAws_restJson1ListReadinessChecksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2293,7 +2293,7 @@ const deserializeAws_restJson1ListRecoveryGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2346,7 +2346,7 @@ const deserializeAws_restJson1ListResourceSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2399,7 +2399,7 @@ const deserializeAws_restJson1ListRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2449,7 +2449,7 @@ const deserializeAws_restJson1ListTagsForResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2493,7 +2493,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2537,7 +2537,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2596,7 +2596,7 @@ const deserializeAws_restJson1UpdateCellCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2658,7 +2658,7 @@ const deserializeAws_restJson1UpdateReadinessCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2720,7 +2720,7 @@ const deserializeAws_restJson1UpdateRecoveryGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2785,7 +2785,7 @@ const deserializeAws_restJson1UpdateResourceSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3344,6 +3344,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts index 8851135329c4..b40cb3b7a734 100644 --- a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts @@ -1237,7 +1237,7 @@ const deserializeAws_json1_1AssociateFirewallRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1296,7 +1296,7 @@ const deserializeAws_json1_1AssociateResolverEndpointIpAddressCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1355,7 +1355,7 @@ const deserializeAws_json1_1AssociateResolverQueryLogConfigCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1417,7 +1417,7 @@ const deserializeAws_json1_1AssociateResolverRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1479,7 +1479,7 @@ const deserializeAws_json1_1CreateFirewallDomainListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1532,7 +1532,7 @@ const deserializeAws_json1_1CreateFirewallRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1588,7 +1588,7 @@ const deserializeAws_json1_1CreateFirewallRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1641,7 +1641,7 @@ const deserializeAws_json1_1CreateResolverEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1700,7 +1700,7 @@ const deserializeAws_json1_1CreateResolverQueryLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1762,7 +1762,7 @@ const deserializeAws_json1_1CreateResolverRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1824,7 +1824,7 @@ const deserializeAws_json1_1DeleteFirewallDomainListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1877,7 +1877,7 @@ const deserializeAws_json1_1DeleteFirewallRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1927,7 +1927,7 @@ const deserializeAws_json1_1DeleteFirewallRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1983,7 +1983,7 @@ const deserializeAws_json1_1DeleteResolverEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2036,7 +2036,7 @@ const deserializeAws_json1_1DeleteResolverQueryLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2092,7 +2092,7 @@ const deserializeAws_json1_1DeleteResolverRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2145,7 +2145,7 @@ const deserializeAws_json1_1DisassociateFirewallRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2201,7 +2201,7 @@ const deserializeAws_json1_1DisassociateResolverEndpointIpAddressCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2257,7 +2257,7 @@ const deserializeAws_json1_1DisassociateResolverQueryLogConfigCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2313,7 +2313,7 @@ const deserializeAws_json1_1DisassociateResolverRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2363,7 +2363,7 @@ const deserializeAws_json1_1GetFirewallConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2416,7 +2416,7 @@ const deserializeAws_json1_1GetFirewallDomainListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2466,7 +2466,7 @@ const deserializeAws_json1_1GetFirewallRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2516,7 +2516,7 @@ const deserializeAws_json1_1GetFirewallRuleGroupAssociationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2566,7 +2566,7 @@ const deserializeAws_json1_1GetFirewallRuleGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2619,7 +2619,7 @@ const deserializeAws_json1_1GetResolverConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2672,7 +2672,7 @@ const deserializeAws_json1_1GetResolverDnssecConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2728,7 +2728,7 @@ const deserializeAws_json1_1GetResolverEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2778,7 +2778,7 @@ const deserializeAws_json1_1GetResolverQueryLogConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2834,7 +2834,7 @@ const deserializeAws_json1_1GetResolverQueryLogConfigAssociationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2890,7 +2890,7 @@ const deserializeAws_json1_1GetResolverQueryLogConfigPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2943,7 +2943,7 @@ const deserializeAws_json1_1GetResolverRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2993,7 +2993,7 @@ const deserializeAws_json1_1GetResolverRuleAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3043,7 +3043,7 @@ const deserializeAws_json1_1GetResolverRulePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3090,7 +3090,7 @@ const deserializeAws_json1_1ImportFirewallDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3149,7 +3149,7 @@ const deserializeAws_json1_1ListFirewallConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3199,7 +3199,7 @@ const deserializeAws_json1_1ListFirewallDomainListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3249,7 +3249,7 @@ const deserializeAws_json1_1ListFirewallDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3302,7 +3302,7 @@ const deserializeAws_json1_1ListFirewallRuleGroupAssociationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3352,7 +3352,7 @@ const deserializeAws_json1_1ListFirewallRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3402,7 +3402,7 @@ const deserializeAws_json1_1ListFirewallRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3455,7 +3455,7 @@ const deserializeAws_json1_1ListResolverConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3511,7 +3511,7 @@ const deserializeAws_json1_1ListResolverDnssecConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3567,7 +3567,7 @@ const deserializeAws_json1_1ListResolverEndpointIpAddressesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3620,7 +3620,7 @@ const deserializeAws_json1_1ListResolverEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3673,7 +3673,7 @@ const deserializeAws_json1_1ListResolverQueryLogConfigAssociationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3729,7 +3729,7 @@ const deserializeAws_json1_1ListResolverQueryLogConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3785,7 +3785,7 @@ const deserializeAws_json1_1ListResolverRuleAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3838,7 +3838,7 @@ const deserializeAws_json1_1ListResolverRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3891,7 +3891,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3947,7 +3947,7 @@ const deserializeAws_json1_1PutFirewallRuleGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4000,7 +4000,7 @@ const deserializeAws_json1_1PutResolverQueryLogConfigPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4056,7 +4056,7 @@ const deserializeAws_json1_1PutResolverRulePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4106,7 +4106,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4165,7 +4165,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4218,7 +4218,7 @@ const deserializeAws_json1_1UpdateFirewallConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4271,7 +4271,7 @@ const deserializeAws_json1_1UpdateFirewallDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4330,7 +4330,7 @@ const deserializeAws_json1_1UpdateFirewallRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4386,7 +4386,7 @@ const deserializeAws_json1_1UpdateFirewallRuleGroupAssociationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4442,7 +4442,7 @@ const deserializeAws_json1_1UpdateResolverConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4504,7 +4504,7 @@ const deserializeAws_json1_1UpdateResolverDnssecConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4560,7 +4560,7 @@ const deserializeAws_json1_1UpdateResolverEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4613,7 +4613,7 @@ const deserializeAws_json1_1UpdateResolverRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6987,6 +6987,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-rum/src/protocols/Aws_restJson1.ts b/clients/client-rum/src/protocols/Aws_restJson1.ts index c68c6ced3c25..8e751215350b 100644 --- a/clients/client-rum/src/protocols/Aws_restJson1.ts +++ b/clients/client-rum/src/protocols/Aws_restJson1.ts @@ -340,7 +340,7 @@ const deserializeAws_restJson1CreateAppMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -393,7 +393,7 @@ const deserializeAws_restJson1DeleteAppMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -449,7 +449,7 @@ const deserializeAws_restJson1GetAppMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -505,7 +505,7 @@ const deserializeAws_restJson1GetAppMonitorDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -561,7 +561,7 @@ const deserializeAws_restJson1ListAppMonitorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -614,7 +614,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -658,7 +658,7 @@ const deserializeAws_restJson1PutRumEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -708,7 +708,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -752,7 +752,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -796,7 +796,7 @@ const deserializeAws_restJson1UpdateAppMonitorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1256,6 +1256,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-s3-control/src/protocols/Aws_restXml.ts b/clients/client-s3-control/src/protocols/Aws_restXml.ts index d31bbe5a0ce8..c43521de6c26 100644 --- a/clients/client-s3-control/src/protocols/Aws_restXml.ts +++ b/clients/client-s3-control/src/protocols/Aws_restXml.ts @@ -2671,7 +2671,7 @@ const deserializeAws_restXmlCreateAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2706,7 +2706,7 @@ const deserializeAws_restXmlCreateAccessPointForObjectLambdaCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2742,7 +2742,7 @@ const deserializeAws_restXmlCreateBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2786,7 +2786,7 @@ const deserializeAws_restXmlCreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2836,7 +2836,7 @@ const deserializeAws_restXmlCreateMultiRegionAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2868,7 +2868,7 @@ const deserializeAws_restXmlDeleteAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2900,7 +2900,7 @@ const deserializeAws_restXmlDeleteAccessPointForObjectLambdaCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2932,7 +2932,7 @@ const deserializeAws_restXmlDeleteAccessPointPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2964,7 +2964,7 @@ const deserializeAws_restXmlDeleteAccessPointPolicyForObjectLambdaCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2996,7 +2996,7 @@ const deserializeAws_restXmlDeleteBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3028,7 +3028,7 @@ const deserializeAws_restXmlDeleteBucketLifecycleConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3060,7 +3060,7 @@ const deserializeAws_restXmlDeleteBucketPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3092,7 +3092,7 @@ const deserializeAws_restXmlDeleteBucketTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3124,7 +3124,7 @@ const deserializeAws_restXmlDeleteJobTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3171,7 +3171,7 @@ const deserializeAws_restXmlDeleteMultiRegionAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3203,7 +3203,7 @@ const deserializeAws_restXmlDeletePublicAccessBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3235,7 +3235,7 @@ const deserializeAws_restXmlDeleteStorageLensConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3267,7 +3267,7 @@ const deserializeAws_restXmlDeleteStorageLensConfigurationTaggingCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3302,7 +3302,7 @@ const deserializeAws_restXmlDescribeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3352,7 +3352,7 @@ const deserializeAws_restXmlDescribeMultiRegionAccessPointOperationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3416,7 +3416,7 @@ const deserializeAws_restXmlGetAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3451,7 +3451,7 @@ const deserializeAws_restXmlGetAccessPointConfigurationForObjectLambdaCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3495,7 +3495,7 @@ const deserializeAws_restXmlGetAccessPointForObjectLambdaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3530,7 +3530,7 @@ const deserializeAws_restXmlGetAccessPointPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3565,7 +3565,7 @@ const deserializeAws_restXmlGetAccessPointPolicyForObjectLambdaCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3600,7 +3600,7 @@ const deserializeAws_restXmlGetAccessPointPolicyStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3635,7 +3635,7 @@ const deserializeAws_restXmlGetAccessPointPolicyStatusForObjectLambdaCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3676,7 +3676,7 @@ const deserializeAws_restXmlGetBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3713,7 +3713,7 @@ const deserializeAws_restXmlGetBucketLifecycleConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3748,7 +3748,7 @@ const deserializeAws_restXmlGetBucketPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3785,7 +3785,7 @@ const deserializeAws_restXmlGetBucketTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3823,7 +3823,7 @@ const deserializeAws_restXmlGetBucketVersioningCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3860,7 +3860,7 @@ const deserializeAws_restXmlGetJobTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3907,7 +3907,7 @@ const deserializeAws_restXmlGetMultiRegionAccessPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3942,7 +3942,7 @@ const deserializeAws_restXmlGetMultiRegionAccessPointPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3977,7 +3977,7 @@ const deserializeAws_restXmlGetMultiRegionAccessPointPolicyStatusCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4010,7 +4010,7 @@ const deserializeAws_restXmlGetPublicAccessBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4049,7 +4049,7 @@ const deserializeAws_restXmlGetStorageLensConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4086,7 +4086,7 @@ const deserializeAws_restXmlGetStorageLensConfigurationTaggingCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4129,7 +4129,7 @@ const deserializeAws_restXmlListAccessPointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4175,7 +4175,7 @@ const deserializeAws_restXmlListAccessPointsForObjectLambdaCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4218,7 +4218,7 @@ const deserializeAws_restXmlListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4273,7 +4273,7 @@ const deserializeAws_restXmlListMultiRegionAccessPointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4316,7 +4316,7 @@ const deserializeAws_restXmlListRegionalBucketsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4359,7 +4359,7 @@ const deserializeAws_restXmlListStorageLensConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4391,7 +4391,7 @@ const deserializeAws_restXmlPutAccessPointConfigurationForObjectLambdaCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4423,7 +4423,7 @@ const deserializeAws_restXmlPutAccessPointPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4455,7 +4455,7 @@ const deserializeAws_restXmlPutAccessPointPolicyForObjectLambdaCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4487,7 +4487,7 @@ const deserializeAws_restXmlPutBucketLifecycleConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4519,7 +4519,7 @@ const deserializeAws_restXmlPutBucketPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4551,7 +4551,7 @@ const deserializeAws_restXmlPutBucketTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4583,7 +4583,7 @@ const deserializeAws_restXmlPutBucketVersioningCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4615,7 +4615,7 @@ const deserializeAws_restXmlPutJobTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4665,7 +4665,7 @@ const deserializeAws_restXmlPutMultiRegionAccessPointPolicyCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4697,7 +4697,7 @@ const deserializeAws_restXmlPutPublicAccessBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4729,7 +4729,7 @@ const deserializeAws_restXmlPutStorageLensConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4761,7 +4761,7 @@ const deserializeAws_restXmlPutStorageLensConfigurationTaggingCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4799,7 +4799,7 @@ const deserializeAws_restXmlUpdateJobPriorityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4855,7 +4855,7 @@ const deserializeAws_restXmlUpdateJobStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8611,6 +8611,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const loadRestXmlErrorCode = (output: __HttpResponse, data: any): string | undefined => { if (data.Error.Code !== undefined) { return data.Error.Code; diff --git a/clients/client-s3/src/protocols/Aws_restXml.ts b/clients/client-s3/src/protocols/Aws_restXml.ts index de9738d1c0e3..533668da5a15 100644 --- a/clients/client-s3/src/protocols/Aws_restXml.ts +++ b/clients/client-s3/src/protocols/Aws_restXml.ts @@ -3737,7 +3737,7 @@ const deserializeAws_restXmlAbortMultipartUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3808,7 +3808,7 @@ const deserializeAws_restXmlCompleteMultipartUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3854,7 +3854,7 @@ const deserializeAws_restXmlCopyObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3893,7 +3893,7 @@ const deserializeAws_restXmlCreateBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3959,7 +3959,7 @@ const deserializeAws_restXmlCreateMultipartUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3991,7 +3991,7 @@ const deserializeAws_restXmlDeleteBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4023,7 +4023,7 @@ const deserializeAws_restXmlDeleteBucketAnalyticsConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4055,7 +4055,7 @@ const deserializeAws_restXmlDeleteBucketCorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4087,7 +4087,7 @@ const deserializeAws_restXmlDeleteBucketEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4119,7 +4119,7 @@ const deserializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4151,7 +4151,7 @@ const deserializeAws_restXmlDeleteBucketInventoryConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4183,7 +4183,7 @@ const deserializeAws_restXmlDeleteBucketLifecycleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4215,7 +4215,7 @@ const deserializeAws_restXmlDeleteBucketMetricsConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4247,7 +4247,7 @@ const deserializeAws_restXmlDeleteBucketOwnershipControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4279,7 +4279,7 @@ const deserializeAws_restXmlDeleteBucketPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4311,7 +4311,7 @@ const deserializeAws_restXmlDeleteBucketReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4343,7 +4343,7 @@ const deserializeAws_restXmlDeleteBucketTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4375,7 +4375,7 @@ const deserializeAws_restXmlDeleteBucketWebsiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4413,7 +4413,7 @@ const deserializeAws_restXmlDeleteObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4456,7 +4456,7 @@ const deserializeAws_restXmlDeleteObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4489,7 +4489,7 @@ const deserializeAws_restXmlDeleteObjectTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4521,7 +4521,7 @@ const deserializeAws_restXmlDeletePublicAccessBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4556,7 +4556,7 @@ const deserializeAws_restXmlGetBucketAccelerateConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4596,7 +4596,7 @@ const deserializeAws_restXmlGetBucketAclCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4629,7 +4629,7 @@ const deserializeAws_restXmlGetBucketAnalyticsConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4666,7 +4666,7 @@ const deserializeAws_restXmlGetBucketCorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4699,7 +4699,7 @@ const deserializeAws_restXmlGetBucketEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4732,7 +4732,7 @@ const deserializeAws_restXmlGetBucketIntelligentTieringConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4765,7 +4765,7 @@ const deserializeAws_restXmlGetBucketInventoryConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4802,7 +4802,7 @@ const deserializeAws_restXmlGetBucketLifecycleConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4837,7 +4837,7 @@ const deserializeAws_restXmlGetBucketLocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4872,7 +4872,7 @@ const deserializeAws_restXmlGetBucketLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4905,7 +4905,7 @@ const deserializeAws_restXmlGetBucketMetricsConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4967,7 +4967,7 @@ const deserializeAws_restXmlGetBucketNotificationConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5000,7 +5000,7 @@ const deserializeAws_restXmlGetBucketOwnershipControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5033,7 +5033,7 @@ const deserializeAws_restXmlGetBucketPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5066,7 +5066,7 @@ const deserializeAws_restXmlGetBucketPolicyStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5099,7 +5099,7 @@ const deserializeAws_restXmlGetBucketReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5134,7 +5134,7 @@ const deserializeAws_restXmlGetBucketRequestPaymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5171,7 +5171,7 @@ const deserializeAws_restXmlGetBucketTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5209,7 +5209,7 @@ const deserializeAws_restXmlGetBucketVersioningCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5261,7 +5261,7 @@ const deserializeAws_restXmlGetBucketWebsiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5364,7 +5364,7 @@ const deserializeAws_restXmlGetObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5414,7 +5414,7 @@ const deserializeAws_restXmlGetObjectAclCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5477,7 +5477,7 @@ const deserializeAws_restXmlGetObjectAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5516,7 +5516,7 @@ const deserializeAws_restXmlGetObjectLegalHoldCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5549,7 +5549,7 @@ const deserializeAws_restXmlGetObjectLockConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5582,7 +5582,7 @@ const deserializeAws_restXmlGetObjectRetentionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5620,7 +5620,7 @@ const deserializeAws_restXmlGetObjectTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5654,7 +5654,7 @@ const deserializeAws_restXmlGetObjectTorrentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5687,7 +5687,7 @@ const deserializeAws_restXmlGetPublicAccessBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5719,7 +5719,7 @@ const deserializeAws_restXmlHeadBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5823,7 +5823,7 @@ const deserializeAws_restXmlHeadObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5878,7 +5878,7 @@ const deserializeAws_restXmlListBucketAnalyticsConfigurationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5927,7 +5927,7 @@ const deserializeAws_restXmlListBucketIntelligentTieringConfigurationsCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5976,7 +5976,7 @@ const deserializeAws_restXmlListBucketInventoryConfigurationsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6025,7 +6025,7 @@ const deserializeAws_restXmlListBucketMetricsConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6065,7 +6065,7 @@ const deserializeAws_restXmlListBucketsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6140,7 +6140,7 @@ const deserializeAws_restXmlListMultipartUploadsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6209,7 +6209,7 @@ const deserializeAws_restXmlListObjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6290,7 +6290,7 @@ const deserializeAws_restXmlListObjectsV2CommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6376,7 +6376,7 @@ const deserializeAws_restXmlListObjectVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6452,7 +6452,7 @@ const deserializeAws_restXmlListPartsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6484,7 +6484,7 @@ const deserializeAws_restXmlPutBucketAccelerateConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6516,7 +6516,7 @@ const deserializeAws_restXmlPutBucketAclCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6548,7 +6548,7 @@ const deserializeAws_restXmlPutBucketAnalyticsConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6580,7 +6580,7 @@ const deserializeAws_restXmlPutBucketCorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6612,7 +6612,7 @@ const deserializeAws_restXmlPutBucketEncryptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6644,7 +6644,7 @@ const deserializeAws_restXmlPutBucketIntelligentTieringConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6676,7 +6676,7 @@ const deserializeAws_restXmlPutBucketInventoryConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6708,7 +6708,7 @@ const deserializeAws_restXmlPutBucketLifecycleConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6740,7 +6740,7 @@ const deserializeAws_restXmlPutBucketLoggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6772,7 +6772,7 @@ const deserializeAws_restXmlPutBucketMetricsConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6804,7 +6804,7 @@ const deserializeAws_restXmlPutBucketNotificationConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6836,7 +6836,7 @@ const deserializeAws_restXmlPutBucketOwnershipControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6868,7 +6868,7 @@ const deserializeAws_restXmlPutBucketPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6900,7 +6900,7 @@ const deserializeAws_restXmlPutBucketReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6932,7 +6932,7 @@ const deserializeAws_restXmlPutBucketRequestPaymentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6964,7 +6964,7 @@ const deserializeAws_restXmlPutBucketTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6996,7 +6996,7 @@ const deserializeAws_restXmlPutBucketVersioningCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7028,7 +7028,7 @@ const deserializeAws_restXmlPutBucketWebsiteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7077,7 +7077,7 @@ const deserializeAws_restXmlPutObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7110,7 +7110,7 @@ const deserializeAws_restXmlPutObjectAclCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7149,7 +7149,7 @@ const deserializeAws_restXmlPutObjectLegalHoldCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7182,7 +7182,7 @@ const deserializeAws_restXmlPutObjectLockConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7215,7 +7215,7 @@ const deserializeAws_restXmlPutObjectRetentionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7248,7 +7248,7 @@ const deserializeAws_restXmlPutObjectTaggingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7280,7 +7280,7 @@ const deserializeAws_restXmlPutPublicAccessBlockCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7314,7 +7314,7 @@ const deserializeAws_restXmlRestoreObjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7353,7 +7353,7 @@ const deserializeAws_restXmlSelectObjectContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7399,7 +7399,7 @@ const deserializeAws_restXmlUploadPartCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7442,7 +7442,7 @@ const deserializeAws_restXmlUploadPartCopyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7474,7 +7474,7 @@ const deserializeAws_restXmlWriteGetObjectResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12061,6 +12061,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const loadRestXmlErrorCode = (output: __HttpResponse, data: any): string | undefined => { if (data.Code !== undefined) { return data.Code; diff --git a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts index ea4882788c0c..4ca8fe5bd896 100644 --- a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts @@ -163,7 +163,7 @@ const deserializeAws_restJson1CreateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -213,7 +213,7 @@ const deserializeAws_restJson1DeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -266,7 +266,7 @@ const deserializeAws_restJson1ListEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -319,7 +319,7 @@ const deserializeAws_restJson1ListSharedEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -513,6 +513,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts index 9e3cca8ff969..f01a7a960655 100644 --- a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts @@ -202,7 +202,7 @@ const deserializeAws_restJson1DeleteHumanLoopCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -273,7 +273,7 @@ const deserializeAws_restJson1DescribeHumanLoopCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -326,7 +326,7 @@ const deserializeAws_restJson1ListHumanLoopsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -376,7 +376,7 @@ const deserializeAws_restJson1StartHumanLoopCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -426,7 +426,7 @@ const deserializeAws_restJson1StopHumanLoopCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -641,6 +641,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts index c46f2e4455be..21dbde23c7a5 100644 --- a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts @@ -137,7 +137,7 @@ const deserializeAws_restJson1GetDeploymentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -181,7 +181,7 @@ const deserializeAws_restJson1GetDeviceRegistrationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -219,7 +219,7 @@ const deserializeAws_restJson1SendHeartbeatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -409,6 +409,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts index a40d236cd767..1d24dec9076b 100644 --- a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts @@ -193,7 +193,7 @@ const deserializeAws_restJson1BatchGetRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -240,7 +240,7 @@ const deserializeAws_restJson1DeleteRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -290,7 +290,7 @@ const deserializeAws_restJson1GetRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -340,7 +340,7 @@ const deserializeAws_restJson1PutRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -662,6 +662,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts index b6f59d03265a..8887f65db762 100644 --- a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts @@ -133,7 +133,7 @@ const deserializeAws_restJson1InvokeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -190,7 +190,7 @@ const deserializeAws_restJson1InvokeEndpointAsyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -354,6 +354,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts index 7d7c4c1bc90c..c4e10f5033b0 100644 --- a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts @@ -5045,7 +5045,7 @@ const deserializeAws_json1_1AddAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5089,7 +5089,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5124,7 +5124,7 @@ const deserializeAws_json1_1AssociateTrialComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5168,7 +5168,7 @@ const deserializeAws_json1_1BatchDescribeModelPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5203,7 +5203,7 @@ const deserializeAws_json1_1CreateActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5244,7 +5244,7 @@ const deserializeAws_json1_1CreateAlgorithmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5279,7 +5279,7 @@ const deserializeAws_json1_1CreateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5323,7 +5323,7 @@ const deserializeAws_json1_1CreateAppImageConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5364,7 +5364,7 @@ const deserializeAws_json1_1CreateArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5405,7 +5405,7 @@ const deserializeAws_json1_1CreateAutoMLJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5449,7 +5449,7 @@ const deserializeAws_json1_1CreateCodeRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5484,7 +5484,7 @@ const deserializeAws_json1_1CreateCompilationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5528,7 +5528,7 @@ const deserializeAws_json1_1CreateContextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5569,7 +5569,7 @@ const deserializeAws_json1_1CreateDataQualityJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5610,7 +5610,7 @@ const deserializeAws_json1_1CreateDeviceFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5654,7 +5654,7 @@ const deserializeAws_json1_1CreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5698,7 +5698,7 @@ const deserializeAws_json1_1CreateEdgeDeploymentPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5736,7 +5736,7 @@ const deserializeAws_json1_1CreateEdgeDeploymentStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5774,7 +5774,7 @@ const deserializeAws_json1_1CreateEdgePackagingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5815,7 +5815,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5856,7 +5856,7 @@ const deserializeAws_json1_1CreateEndpointConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5897,7 +5897,7 @@ const deserializeAws_json1_1CreateExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5938,7 +5938,7 @@ const deserializeAws_json1_1CreateFeatureGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5982,7 +5982,7 @@ const deserializeAws_json1_1CreateFlowDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6026,7 +6026,7 @@ const deserializeAws_json1_1CreateHumanTaskUiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6070,7 +6070,7 @@ const deserializeAws_json1_1CreateHyperParameterTuningJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6114,7 +6114,7 @@ const deserializeAws_json1_1CreateImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6158,7 +6158,7 @@ const deserializeAws_json1_1CreateImageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6205,7 +6205,7 @@ const deserializeAws_json1_1CreateInferenceRecommendationsJobCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6249,7 +6249,7 @@ const deserializeAws_json1_1CreateLabelingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6293,7 +6293,7 @@ const deserializeAws_json1_1CreateModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6334,7 +6334,7 @@ const deserializeAws_json1_1CreateModelBiasJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6378,7 +6378,7 @@ const deserializeAws_json1_1CreateModelExplainabilityJobDefinitionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6422,7 +6422,7 @@ const deserializeAws_json1_1CreateModelPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6466,7 +6466,7 @@ const deserializeAws_json1_1CreateModelPackageGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6507,7 +6507,7 @@ const deserializeAws_json1_1CreateModelQualityJobDefinitionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6551,7 +6551,7 @@ const deserializeAws_json1_1CreateMonitoringScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6595,7 +6595,7 @@ const deserializeAws_json1_1CreateNotebookInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6636,7 +6636,7 @@ const deserializeAws_json1_1CreateNotebookInstanceLifecycleConfigCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6677,7 +6677,7 @@ const deserializeAws_json1_1CreatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6721,7 +6721,7 @@ const deserializeAws_json1_1CreatePresignedDomainUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6762,7 +6762,7 @@ const deserializeAws_json1_1CreatePresignedNotebookInstanceUrlCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6797,7 +6797,7 @@ const deserializeAws_json1_1CreateProcessingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6844,7 +6844,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6885,7 +6885,7 @@ const deserializeAws_json1_1CreateStudioLifecycleConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6926,7 +6926,7 @@ const deserializeAws_json1_1CreateTrainingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6973,7 +6973,7 @@ const deserializeAws_json1_1CreateTransformJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7020,7 +7020,7 @@ const deserializeAws_json1_1CreateTrialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7064,7 +7064,7 @@ const deserializeAws_json1_1CreateTrialComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7105,7 +7105,7 @@ const deserializeAws_json1_1CreateUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7149,7 +7149,7 @@ const deserializeAws_json1_1CreateWorkforceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7184,7 +7184,7 @@ const deserializeAws_json1_1CreateWorkteamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7228,7 +7228,7 @@ const deserializeAws_json1_1DeleteActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7266,7 +7266,7 @@ const deserializeAws_json1_1DeleteAlgorithmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7298,7 +7298,7 @@ const deserializeAws_json1_1DeleteAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7339,7 +7339,7 @@ const deserializeAws_json1_1DeleteAppImageConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7380,7 +7380,7 @@ const deserializeAws_json1_1DeleteArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7421,7 +7421,7 @@ const deserializeAws_json1_1DeleteAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7459,7 +7459,7 @@ const deserializeAws_json1_1DeleteCodeRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7494,7 +7494,7 @@ const deserializeAws_json1_1DeleteContextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7532,7 +7532,7 @@ const deserializeAws_json1_1DeleteDataQualityJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7570,7 +7570,7 @@ const deserializeAws_json1_1DeleteDeviceFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7608,7 +7608,7 @@ const deserializeAws_json1_1DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7649,7 +7649,7 @@ const deserializeAws_json1_1DeleteEdgeDeploymentPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7687,7 +7687,7 @@ const deserializeAws_json1_1DeleteEdgeDeploymentStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7725,7 +7725,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7757,7 +7757,7 @@ const deserializeAws_json1_1DeleteEndpointConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -7792,7 +7792,7 @@ const deserializeAws_json1_1DeleteExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7830,7 +7830,7 @@ const deserializeAws_json1_1DeleteFeatureGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7871,7 +7871,7 @@ const deserializeAws_json1_1DeleteFlowDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7915,7 +7915,7 @@ const deserializeAws_json1_1DeleteHumanTaskUiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7956,7 +7956,7 @@ const deserializeAws_json1_1DeleteImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8000,7 +8000,7 @@ const deserializeAws_json1_1DeleteImageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8041,7 +8041,7 @@ const deserializeAws_json1_1DeleteModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8073,7 +8073,7 @@ const deserializeAws_json1_1DeleteModelBiasJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8111,7 +8111,7 @@ const deserializeAws_json1_1DeleteModelExplainabilityJobDefinitionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8149,7 +8149,7 @@ const deserializeAws_json1_1DeleteModelPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8187,7 +8187,7 @@ const deserializeAws_json1_1DeleteModelPackageGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8225,7 +8225,7 @@ const deserializeAws_json1_1DeleteModelPackageGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8257,7 +8257,7 @@ const deserializeAws_json1_1DeleteModelQualityJobDefinitionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8295,7 +8295,7 @@ const deserializeAws_json1_1DeleteMonitoringScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8333,7 +8333,7 @@ const deserializeAws_json1_1DeleteNotebookInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8365,7 +8365,7 @@ const deserializeAws_json1_1DeleteNotebookInstanceLifecycleConfigCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8400,7 +8400,7 @@ const deserializeAws_json1_1DeletePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8438,7 +8438,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8476,7 +8476,7 @@ const deserializeAws_json1_1DeleteStudioLifecycleConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8520,7 +8520,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8555,7 +8555,7 @@ const deserializeAws_json1_1DeleteTrialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8596,7 +8596,7 @@ const deserializeAws_json1_1DeleteTrialComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8634,7 +8634,7 @@ const deserializeAws_json1_1DeleteUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8678,7 +8678,7 @@ const deserializeAws_json1_1DeleteWorkforceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8713,7 +8713,7 @@ const deserializeAws_json1_1DeleteWorkteamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8751,7 +8751,7 @@ const deserializeAws_json1_1DeregisterDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8786,7 +8786,7 @@ const deserializeAws_json1_1DescribeActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8827,7 +8827,7 @@ const deserializeAws_json1_1DescribeAlgorithmCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -8862,7 +8862,7 @@ const deserializeAws_json1_1DescribeAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8903,7 +8903,7 @@ const deserializeAws_json1_1DescribeAppImageConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8944,7 +8944,7 @@ const deserializeAws_json1_1DescribeArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8985,7 +8985,7 @@ const deserializeAws_json1_1DescribeAutoMLJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9026,7 +9026,7 @@ const deserializeAws_json1_1DescribeCodeRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9061,7 +9061,7 @@ const deserializeAws_json1_1DescribeCompilationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9102,7 +9102,7 @@ const deserializeAws_json1_1DescribeContextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9143,7 +9143,7 @@ const deserializeAws_json1_1DescribeDataQualityJobDefinitionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9184,7 +9184,7 @@ const deserializeAws_json1_1DescribeDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9225,7 +9225,7 @@ const deserializeAws_json1_1DescribeDeviceFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9266,7 +9266,7 @@ const deserializeAws_json1_1DescribeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9307,7 +9307,7 @@ const deserializeAws_json1_1DescribeEdgeDeploymentPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9348,7 +9348,7 @@ const deserializeAws_json1_1DescribeEdgePackagingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9389,7 +9389,7 @@ const deserializeAws_json1_1DescribeEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9424,7 +9424,7 @@ const deserializeAws_json1_1DescribeEndpointConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9459,7 +9459,7 @@ const deserializeAws_json1_1DescribeExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9500,7 +9500,7 @@ const deserializeAws_json1_1DescribeFeatureGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9541,7 +9541,7 @@ const deserializeAws_json1_1DescribeFeatureMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9582,7 +9582,7 @@ const deserializeAws_json1_1DescribeFlowDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9623,7 +9623,7 @@ const deserializeAws_json1_1DescribeHumanTaskUiCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9664,7 +9664,7 @@ const deserializeAws_json1_1DescribeHyperParameterTuningJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9705,7 +9705,7 @@ const deserializeAws_json1_1DescribeImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9746,7 +9746,7 @@ const deserializeAws_json1_1DescribeImageVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9787,7 +9787,7 @@ const deserializeAws_json1_1DescribeInferenceRecommendationsJobCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9828,7 +9828,7 @@ const deserializeAws_json1_1DescribeLabelingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9869,7 +9869,7 @@ const deserializeAws_json1_1DescribeLineageGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9910,7 +9910,7 @@ const deserializeAws_json1_1DescribeModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9945,7 +9945,7 @@ const deserializeAws_json1_1DescribeModelBiasJobDefinitionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9986,7 +9986,7 @@ const deserializeAws_json1_1DescribeModelExplainabilityJobDefinitionCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10027,7 +10027,7 @@ const deserializeAws_json1_1DescribeModelPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10062,7 +10062,7 @@ const deserializeAws_json1_1DescribeModelPackageGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10097,7 +10097,7 @@ const deserializeAws_json1_1DescribeModelQualityJobDefinitionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10138,7 +10138,7 @@ const deserializeAws_json1_1DescribeMonitoringScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10179,7 +10179,7 @@ const deserializeAws_json1_1DescribeNotebookInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10214,7 +10214,7 @@ const deserializeAws_json1_1DescribeNotebookInstanceLifecycleConfigCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10249,7 +10249,7 @@ const deserializeAws_json1_1DescribePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10290,7 +10290,7 @@ const deserializeAws_json1_1DescribePipelineDefinitionForExecutionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10331,7 +10331,7 @@ const deserializeAws_json1_1DescribePipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10372,7 +10372,7 @@ const deserializeAws_json1_1DescribeProcessingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10413,7 +10413,7 @@ const deserializeAws_json1_1DescribeProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10448,7 +10448,7 @@ const deserializeAws_json1_1DescribeStudioLifecycleConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10489,7 +10489,7 @@ const deserializeAws_json1_1DescribeSubscribedWorkteamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10524,7 +10524,7 @@ const deserializeAws_json1_1DescribeTrainingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10565,7 +10565,7 @@ const deserializeAws_json1_1DescribeTransformJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10606,7 +10606,7 @@ const deserializeAws_json1_1DescribeTrialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10647,7 +10647,7 @@ const deserializeAws_json1_1DescribeTrialComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10688,7 +10688,7 @@ const deserializeAws_json1_1DescribeUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10729,7 +10729,7 @@ const deserializeAws_json1_1DescribeWorkforceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10764,7 +10764,7 @@ const deserializeAws_json1_1DescribeWorkteamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10799,7 +10799,7 @@ const deserializeAws_json1_1DisableSagemakerServicecatalogPortfolioCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10834,7 +10834,7 @@ const deserializeAws_json1_1DisassociateTrialComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10875,7 +10875,7 @@ const deserializeAws_json1_1EnableSagemakerServicecatalogPortfolioCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10910,7 +10910,7 @@ const deserializeAws_json1_1GetDeviceFleetReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -10945,7 +10945,7 @@ const deserializeAws_json1_1GetLineageGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -10986,7 +10986,7 @@ const deserializeAws_json1_1GetModelPackageGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11021,7 +11021,7 @@ const deserializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11056,7 +11056,7 @@ const deserializeAws_json1_1GetSearchSuggestionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11091,7 +11091,7 @@ const deserializeAws_json1_1ListActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11132,7 +11132,7 @@ const deserializeAws_json1_1ListAlgorithmsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11167,7 +11167,7 @@ const deserializeAws_json1_1ListAppImageConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11202,7 +11202,7 @@ const deserializeAws_json1_1ListAppsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11237,7 +11237,7 @@ const deserializeAws_json1_1ListArtifactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11278,7 +11278,7 @@ const deserializeAws_json1_1ListAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11319,7 +11319,7 @@ const deserializeAws_json1_1ListAutoMLJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11354,7 +11354,7 @@ const deserializeAws_json1_1ListCandidatesForAutoMLJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11395,7 +11395,7 @@ const deserializeAws_json1_1ListCodeRepositoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11430,7 +11430,7 @@ const deserializeAws_json1_1ListCompilationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11465,7 +11465,7 @@ const deserializeAws_json1_1ListContextsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -11506,7 +11506,7 @@ const deserializeAws_json1_1ListDataQualityJobDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11541,7 +11541,7 @@ const deserializeAws_json1_1ListDeviceFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11576,7 +11576,7 @@ const deserializeAws_json1_1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11611,7 +11611,7 @@ const deserializeAws_json1_1ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11646,7 +11646,7 @@ const deserializeAws_json1_1ListEdgeDeploymentPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11681,7 +11681,7 @@ const deserializeAws_json1_1ListEdgePackagingJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11716,7 +11716,7 @@ const deserializeAws_json1_1ListEndpointConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11751,7 +11751,7 @@ const deserializeAws_json1_1ListEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11786,7 +11786,7 @@ const deserializeAws_json1_1ListExperimentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11821,7 +11821,7 @@ const deserializeAws_json1_1ListFeatureGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11856,7 +11856,7 @@ const deserializeAws_json1_1ListFlowDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11891,7 +11891,7 @@ const deserializeAws_json1_1ListHumanTaskUisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11926,7 +11926,7 @@ const deserializeAws_json1_1ListHyperParameterTuningJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11961,7 +11961,7 @@ const deserializeAws_json1_1ListImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -11996,7 +11996,7 @@ const deserializeAws_json1_1ListImageVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12037,7 +12037,7 @@ const deserializeAws_json1_1ListInferenceRecommendationsJobsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12072,7 +12072,7 @@ const deserializeAws_json1_1ListLabelingJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12107,7 +12107,7 @@ const deserializeAws_json1_1ListLabelingJobsForWorkteamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12148,7 +12148,7 @@ const deserializeAws_json1_1ListLineageGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12183,7 +12183,7 @@ const deserializeAws_json1_1ListModelBiasJobDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12218,7 +12218,7 @@ const deserializeAws_json1_1ListModelExplainabilityJobDefinitionsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12253,7 +12253,7 @@ const deserializeAws_json1_1ListModelMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12288,7 +12288,7 @@ const deserializeAws_json1_1ListModelPackageGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12323,7 +12323,7 @@ const deserializeAws_json1_1ListModelPackagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12358,7 +12358,7 @@ const deserializeAws_json1_1ListModelQualityJobDefinitionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12393,7 +12393,7 @@ const deserializeAws_json1_1ListModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12428,7 +12428,7 @@ const deserializeAws_json1_1ListMonitoringExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12463,7 +12463,7 @@ const deserializeAws_json1_1ListMonitoringSchedulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12498,7 +12498,7 @@ const deserializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12533,7 +12533,7 @@ const deserializeAws_json1_1ListNotebookInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12568,7 +12568,7 @@ const deserializeAws_json1_1ListPipelineExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12609,7 +12609,7 @@ const deserializeAws_json1_1ListPipelineExecutionStepsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12650,7 +12650,7 @@ const deserializeAws_json1_1ListPipelineParametersForExecutionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12691,7 +12691,7 @@ const deserializeAws_json1_1ListPipelinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12726,7 +12726,7 @@ const deserializeAws_json1_1ListProcessingJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12761,7 +12761,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12796,7 +12796,7 @@ const deserializeAws_json1_1ListStageDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12831,7 +12831,7 @@ const deserializeAws_json1_1ListStudioLifecycleConfigsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -12872,7 +12872,7 @@ const deserializeAws_json1_1ListSubscribedWorkteamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12907,7 +12907,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12942,7 +12942,7 @@ const deserializeAws_json1_1ListTrainingJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -12977,7 +12977,7 @@ const deserializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13018,7 +13018,7 @@ const deserializeAws_json1_1ListTransformJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13053,7 +13053,7 @@ const deserializeAws_json1_1ListTrialComponentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13094,7 +13094,7 @@ const deserializeAws_json1_1ListTrialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13135,7 +13135,7 @@ const deserializeAws_json1_1ListUserProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13170,7 +13170,7 @@ const deserializeAws_json1_1ListWorkforcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13205,7 +13205,7 @@ const deserializeAws_json1_1ListWorkteamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13240,7 +13240,7 @@ const deserializeAws_json1_1PutModelPackageGroupPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13275,7 +13275,7 @@ const deserializeAws_json1_1QueryLineageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13313,7 +13313,7 @@ const deserializeAws_json1_1RegisterDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13354,7 +13354,7 @@ const deserializeAws_json1_1RenderUiTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13395,7 +13395,7 @@ const deserializeAws_json1_1RetryPipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13442,7 +13442,7 @@ const deserializeAws_json1_1SearchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13477,7 +13477,7 @@ const deserializeAws_json1_1SendPipelineExecutionStepFailureCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13521,7 +13521,7 @@ const deserializeAws_json1_1SendPipelineExecutionStepSuccessCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13562,7 +13562,7 @@ const deserializeAws_json1_1StartEdgeDeploymentStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13594,7 +13594,7 @@ const deserializeAws_json1_1StartMonitoringScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13632,7 +13632,7 @@ const deserializeAws_json1_1StartNotebookInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13673,7 +13673,7 @@ const deserializeAws_json1_1StartPipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13714,7 +13714,7 @@ const deserializeAws_json1_1StopAutoMLJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13752,7 +13752,7 @@ const deserializeAws_json1_1StopCompilationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13790,7 +13790,7 @@ const deserializeAws_json1_1StopEdgeDeploymentStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13822,7 +13822,7 @@ const deserializeAws_json1_1StopEdgePackagingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -13854,7 +13854,7 @@ const deserializeAws_json1_1StopHyperParameterTuningJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13892,7 +13892,7 @@ const deserializeAws_json1_1StopInferenceRecommendationsJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13930,7 +13930,7 @@ const deserializeAws_json1_1StopLabelingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -13968,7 +13968,7 @@ const deserializeAws_json1_1StopMonitoringScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14006,7 +14006,7 @@ const deserializeAws_json1_1StopNotebookInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14041,7 +14041,7 @@ const deserializeAws_json1_1StopPipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14079,7 +14079,7 @@ const deserializeAws_json1_1StopProcessingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14117,7 +14117,7 @@ const deserializeAws_json1_1StopTrainingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14155,7 +14155,7 @@ const deserializeAws_json1_1StopTransformJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14196,7 +14196,7 @@ const deserializeAws_json1_1UpdateActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14240,7 +14240,7 @@ const deserializeAws_json1_1UpdateAppImageConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14281,7 +14281,7 @@ const deserializeAws_json1_1UpdateArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14325,7 +14325,7 @@ const deserializeAws_json1_1UpdateCodeRepositoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14360,7 +14360,7 @@ const deserializeAws_json1_1UpdateContextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14401,7 +14401,7 @@ const deserializeAws_json1_1UpdateDeviceFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14439,7 +14439,7 @@ const deserializeAws_json1_1UpdateDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14474,7 +14474,7 @@ const deserializeAws_json1_1UpdateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14521,7 +14521,7 @@ const deserializeAws_json1_1UpdateEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14562,7 +14562,7 @@ const deserializeAws_json1_1UpdateEndpointWeightsAndCapacitiesCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14603,7 +14603,7 @@ const deserializeAws_json1_1UpdateExperimentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14647,7 +14647,7 @@ const deserializeAws_json1_1UpdateFeatureGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14685,7 +14685,7 @@ const deserializeAws_json1_1UpdateFeatureMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14726,7 +14726,7 @@ const deserializeAws_json1_1UpdateImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14770,7 +14770,7 @@ const deserializeAws_json1_1UpdateModelPackageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -14805,7 +14805,7 @@ const deserializeAws_json1_1UpdateMonitoringScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14849,7 +14849,7 @@ const deserializeAws_json1_1UpdateNotebookInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14890,7 +14890,7 @@ const deserializeAws_json1_1UpdateNotebookInstanceLifecycleConfigCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14931,7 +14931,7 @@ const deserializeAws_json1_1UpdatePipelineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -14972,7 +14972,7 @@ const deserializeAws_json1_1UpdatePipelineExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15013,7 +15013,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -15048,7 +15048,7 @@ const deserializeAws_json1_1UpdateTrainingJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15089,7 +15089,7 @@ const deserializeAws_json1_1UpdateTrialCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15133,7 +15133,7 @@ const deserializeAws_json1_1UpdateTrialComponentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15177,7 +15177,7 @@ const deserializeAws_json1_1UpdateUserProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15224,7 +15224,7 @@ const deserializeAws_json1_1UpdateWorkforceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -15265,7 +15265,7 @@ const deserializeAws_json1_1UpdateWorkteamCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -34042,6 +34042,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts index 8d61a307127e..e8f586c3ce0c 100644 --- a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts +++ b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts @@ -383,7 +383,7 @@ const deserializeAws_restJson1CreateSavingsPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -430,7 +430,7 @@ const deserializeAws_restJson1DeleteQueuedSavingsPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -486,7 +486,7 @@ const deserializeAws_restJson1DescribeSavingsPlanRatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -533,7 +533,7 @@ const deserializeAws_restJson1DescribeSavingsPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -580,7 +580,7 @@ const deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -627,7 +627,7 @@ const deserializeAws_restJson1DescribeSavingsPlansOfferingsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -671,7 +671,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -715,7 +715,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -762,7 +762,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1395,6 +1395,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-schemas/src/protocols/Aws_restJson1.ts b/clients/client-schemas/src/protocols/Aws_restJson1.ts index 5864d7ca9809..cdf7522c8fc7 100644 --- a/clients/client-schemas/src/protocols/Aws_restJson1.ts +++ b/clients/client-schemas/src/protocols/Aws_restJson1.ts @@ -1073,7 +1073,7 @@ const deserializeAws_restJson1CreateDiscovererCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1138,7 +1138,7 @@ const deserializeAws_restJson1CreateRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1215,7 +1215,7 @@ const deserializeAws_restJson1CreateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1262,7 +1262,7 @@ const deserializeAws_restJson1DeleteDiscovererCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1315,7 +1315,7 @@ const deserializeAws_restJson1DeleteRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1368,7 +1368,7 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1421,7 +1421,7 @@ const deserializeAws_restJson1DeleteSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1474,7 +1474,7 @@ const deserializeAws_restJson1DeleteSchemaVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1539,7 +1539,7 @@ const deserializeAws_restJson1DescribeCodeBindingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1613,7 +1613,7 @@ const deserializeAws_restJson1DescribeDiscovererCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1678,7 +1678,7 @@ const deserializeAws_restJson1DescribeRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1758,7 +1758,7 @@ const deserializeAws_restJson1DescribeSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1826,7 +1826,7 @@ const deserializeAws_restJson1ExportSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1883,7 +1883,7 @@ const deserializeAws_restJson1GetCodeBindingSourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1939,7 +1939,7 @@ const deserializeAws_restJson1GetDiscoveredSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1995,7 +1995,7 @@ const deserializeAws_restJson1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2054,7 +2054,7 @@ const deserializeAws_restJson1ListDiscoverersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2110,7 +2110,7 @@ const deserializeAws_restJson1ListRegistriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2166,7 +2166,7 @@ const deserializeAws_restJson1ListSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2222,7 +2222,7 @@ const deserializeAws_restJson1ListSchemaVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2278,7 +2278,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2337,7 +2337,7 @@ const deserializeAws_restJson1PutCodeBindingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2399,7 +2399,7 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2461,7 +2461,7 @@ const deserializeAws_restJson1SearchSchemasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2517,7 +2517,7 @@ const deserializeAws_restJson1StartDiscovererCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2576,7 +2576,7 @@ const deserializeAws_restJson1StopDiscovererCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2629,7 +2629,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2676,7 +2676,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2744,7 +2744,7 @@ const deserializeAws_restJson1UpdateDiscovererCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2809,7 +2809,7 @@ const deserializeAws_restJson1UpdateRegistryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2886,7 +2886,7 @@ const deserializeAws_restJson1UpdateSchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3322,6 +3322,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts index abb6b757f18f..7572002af06f 100644 --- a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts @@ -436,7 +436,7 @@ const deserializeAws_json1_1CancelRotateSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -486,7 +486,7 @@ const deserializeAws_json1_1CreateSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -554,7 +554,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -604,7 +604,7 @@ const deserializeAws_json1_1DeleteSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -654,7 +654,7 @@ const deserializeAws_json1_1DescribeSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -701,7 +701,7 @@ const deserializeAws_json1_1GetRandomPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -748,7 +748,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -798,7 +798,7 @@ const deserializeAws_json1_1GetSecretValueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -851,7 +851,7 @@ const deserializeAws_json1_1ListSecretsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -898,7 +898,7 @@ const deserializeAws_json1_1ListSecretVersionIdsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -948,7 +948,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1004,7 +1004,7 @@ const deserializeAws_json1_1PutSecretValueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1066,7 +1066,7 @@ const deserializeAws_json1_1RemoveRegionsFromReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1116,7 +1116,7 @@ const deserializeAws_json1_1ReplicateSecretToRegionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1166,7 +1166,7 @@ const deserializeAws_json1_1RestoreSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1216,7 +1216,7 @@ const deserializeAws_json1_1RotateSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1266,7 +1266,7 @@ const deserializeAws_json1_1StopReplicationToReplicaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1313,7 +1313,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1360,7 +1360,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1410,7 +1410,7 @@ const deserializeAws_json1_1UpdateSecretCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_json1_1UpdateSecretVersionStageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_json1_1ValidateResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2627,6 +2627,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-securityhub/src/protocols/Aws_restJson1.ts b/clients/client-securityhub/src/protocols/Aws_restJson1.ts index 203cd875faea..35118670d32a 100644 --- a/clients/client-securityhub/src/protocols/Aws_restJson1.ts +++ b/clients/client-securityhub/src/protocols/Aws_restJson1.ts @@ -2126,7 +2126,7 @@ const deserializeAws_restJson1AcceptAdministratorInvitationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2176,7 +2176,7 @@ const deserializeAws_restJson1AcceptInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2232,7 +2232,7 @@ const deserializeAws_restJson1BatchDisableStandardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2285,7 +2285,7 @@ const deserializeAws_restJson1BatchEnableStandardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2341,7 +2341,7 @@ const deserializeAws_restJson1BatchImportFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2400,7 +2400,7 @@ const deserializeAws_restJson1BatchUpdateFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2450,7 +2450,7 @@ const deserializeAws_restJson1CreateActionTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2512,7 +2512,7 @@ const deserializeAws_restJson1CreateFindingAggregatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2565,7 +2565,7 @@ const deserializeAws_restJson1CreateInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2618,7 +2618,7 @@ const deserializeAws_restJson1CreateMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2671,7 +2671,7 @@ const deserializeAws_restJson1DeclineInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2721,7 +2721,7 @@ const deserializeAws_restJson1DeleteActionTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2768,7 +2768,7 @@ const deserializeAws_restJson1DeleteFindingAggregatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2824,7 +2824,7 @@ const deserializeAws_restJson1DeleteInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2877,7 +2877,7 @@ const deserializeAws_restJson1DeleteInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2930,7 +2930,7 @@ const deserializeAws_restJson1DeleteMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2986,7 +2986,7 @@ const deserializeAws_restJson1DescribeActionTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3042,7 +3042,7 @@ const deserializeAws_restJson1DescribeHubCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3101,7 +3101,7 @@ const deserializeAws_restJson1DescribeOrganizationConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3154,7 +3154,7 @@ const deserializeAws_restJson1DescribeProductsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3207,7 +3207,7 @@ const deserializeAws_restJson1DescribeStandardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3257,7 +3257,7 @@ const deserializeAws_restJson1DescribeStandardsControlsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3304,7 +3304,7 @@ const deserializeAws_restJson1DisableImportFindingsForProductCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3354,7 +3354,7 @@ const deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3401,7 +3401,7 @@ const deserializeAws_restJson1DisableSecurityHubCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3448,7 +3448,7 @@ const deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3498,7 +3498,7 @@ const deserializeAws_restJson1DisassociateFromMasterAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3548,7 +3548,7 @@ const deserializeAws_restJson1DisassociateMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3601,7 +3601,7 @@ const deserializeAws_restJson1EnableImportFindingsForProductCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3651,7 +3651,7 @@ const deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3698,7 +3698,7 @@ const deserializeAws_restJson1EnableSecurityHubCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3751,7 +3751,7 @@ const deserializeAws_restJson1GetAdministratorAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3810,7 +3810,7 @@ const deserializeAws_restJson1GetEnabledStandardsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3869,7 +3869,7 @@ const deserializeAws_restJson1GetFindingAggregatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3928,7 +3928,7 @@ const deserializeAws_restJson1GetFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3978,7 +3978,7 @@ const deserializeAws_restJson1GetInsightResultsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4034,7 +4034,7 @@ const deserializeAws_restJson1GetInsightsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4087,7 +4087,7 @@ const deserializeAws_restJson1GetInvitationsCountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4137,7 +4137,7 @@ const deserializeAws_restJson1GetMasterAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4193,7 +4193,7 @@ const deserializeAws_restJson1GetMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4246,7 +4246,7 @@ const deserializeAws_restJson1InviteMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4305,7 +4305,7 @@ const deserializeAws_restJson1ListEnabledProductsForImportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4355,7 +4355,7 @@ const deserializeAws_restJson1ListFindingAggregatorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4411,7 +4411,7 @@ const deserializeAws_restJson1ListInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4464,7 +4464,7 @@ const deserializeAws_restJson1ListMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4517,7 +4517,7 @@ const deserializeAws_restJson1ListOrganizationAdminAccountsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4567,7 +4567,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4611,7 +4611,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4655,7 +4655,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4699,7 +4699,7 @@ const deserializeAws_restJson1UpdateActionTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4758,7 +4758,7 @@ const deserializeAws_restJson1UpdateFindingAggregatorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4811,7 +4811,7 @@ const deserializeAws_restJson1UpdateFindingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4861,7 +4861,7 @@ const deserializeAws_restJson1UpdateInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4911,7 +4911,7 @@ const deserializeAws_restJson1UpdateOrganizationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4958,7 +4958,7 @@ const deserializeAws_restJson1UpdateSecurityHubConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5008,7 +5008,7 @@ const deserializeAws_restJson1UpdateStandardsControlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -25562,6 +25562,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts index 75e1dc255e0f..07974fe19efc 100644 --- a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts +++ b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts @@ -622,7 +622,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -702,7 +702,7 @@ const deserializeAws_restJson1CreateApplicationVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -764,7 +764,7 @@ const deserializeAws_restJson1CreateCloudFormationChangeSetCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -832,7 +832,7 @@ const deserializeAws_restJson1CreateCloudFormationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -882,7 +882,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -974,7 +974,7 @@ const deserializeAws_restJson1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1027,7 +1027,7 @@ const deserializeAws_restJson1GetApplicationPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1098,7 +1098,7 @@ const deserializeAws_restJson1GetCloudFormationTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1154,7 +1154,7 @@ const deserializeAws_restJson1ListApplicationDependenciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1210,7 +1210,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1263,7 +1263,7 @@ const deserializeAws_restJson1ListApplicationVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1316,7 +1316,7 @@ const deserializeAws_restJson1PutApplicationPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1366,7 +1366,7 @@ const deserializeAws_restJson1UnshareApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1455,7 +1455,7 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1912,6 +1912,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts index a590318a3720..49f64b2189eb 100644 --- a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts +++ b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts @@ -716,7 +716,7 @@ const deserializeAws_restJson1AssociateAttributeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -772,7 +772,7 @@ const deserializeAws_restJson1AssociateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -825,7 +825,7 @@ const deserializeAws_restJson1CreateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -875,7 +875,7 @@ const deserializeAws_restJson1CreateAttributeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -972,7 +972,7 @@ const deserializeAws_restJson1DeleteAttributeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1022,7 +1022,7 @@ const deserializeAws_restJson1DisassociateAttributeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1072,7 +1072,7 @@ const deserializeAws_restJson1DisassociateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1143,7 +1143,7 @@ const deserializeAws_restJson1GetApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1193,7 +1193,7 @@ const deserializeAws_restJson1GetAssociatedResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1261,7 +1261,7 @@ const deserializeAws_restJson1GetAttributeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1314,7 +1314,7 @@ const deserializeAws_restJson1ListApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1361,7 +1361,7 @@ const deserializeAws_restJson1ListAssociatedAttributeGroupsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1411,7 +1411,7 @@ const deserializeAws_restJson1ListAssociatedResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1461,7 +1461,7 @@ const deserializeAws_restJson1ListAttributeGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1511,7 +1511,7 @@ const deserializeAws_restJson1ListAttributeGroupsForApplicationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1558,7 +1558,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1611,7 +1611,7 @@ const deserializeAws_restJson1SyncResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1655,7 +1655,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1699,7 +1699,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1746,7 +1746,7 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1796,7 +1796,7 @@ const deserializeAws_restJson1UpdateAttributeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2132,6 +2132,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts index fc825cba422c..01762c3ab953 100644 --- a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts @@ -1693,7 +1693,7 @@ const deserializeAws_json1_1AcceptPortfolioShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_json1_1AssociateBudgetWithResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1790,7 +1790,7 @@ const deserializeAws_json1_1AssociatePrincipalWithPortfolioCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1837,7 +1837,7 @@ const deserializeAws_json1_1AssociateProductWithPortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1884,7 +1884,7 @@ const deserializeAws_json1_1AssociateServiceActionWithProvisioningArtifactComman ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1931,7 +1931,7 @@ const deserializeAws_json1_1AssociateTagOptionWithResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1987,7 +1987,7 @@ const deserializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactC ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2028,7 +2028,7 @@ const deserializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifa ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2069,7 +2069,7 @@ const deserializeAws_json1_1CopyProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2113,7 +2113,7 @@ const deserializeAws_json1_1CreateConstraintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2163,7 +2163,7 @@ const deserializeAws_json1_1CreatePortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2210,7 +2210,7 @@ const deserializeAws_json1_1CreatePortfolioShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2263,7 +2263,7 @@ const deserializeAws_json1_1CreateProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2310,7 +2310,7 @@ const deserializeAws_json1_1CreateProvisionedProductPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2357,7 +2357,7 @@ const deserializeAws_json1_1CreateProvisioningArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2404,7 +2404,7 @@ const deserializeAws_json1_1CreateServiceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2448,7 +2448,7 @@ const deserializeAws_json1_1CreateTagOptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2495,7 +2495,7 @@ const deserializeAws_json1_1DeleteConstraintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2539,7 +2539,7 @@ const deserializeAws_json1_1DeletePortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2589,7 +2589,7 @@ const deserializeAws_json1_1DeletePortfolioShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2639,7 +2639,7 @@ const deserializeAws_json1_1DeleteProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2689,7 +2689,7 @@ const deserializeAws_json1_1DeleteProvisionedProductPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2733,7 +2733,7 @@ const deserializeAws_json1_1DeleteProvisioningArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2780,7 +2780,7 @@ const deserializeAws_json1_1DeleteServiceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2824,7 +2824,7 @@ const deserializeAws_json1_1DeleteTagOptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2871,7 +2871,7 @@ const deserializeAws_json1_1DescribeConstraintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2912,7 +2912,7 @@ const deserializeAws_json1_1DescribeCopyProductStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2953,7 +2953,7 @@ const deserializeAws_json1_1DescribePortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2994,7 +2994,7 @@ const deserializeAws_json1_1DescribePortfolioSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3038,7 +3038,7 @@ const deserializeAws_json1_1DescribePortfolioShareStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3085,7 +3085,7 @@ const deserializeAws_json1_1DescribeProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3129,7 +3129,7 @@ const deserializeAws_json1_1DescribeProductAsAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3173,7 +3173,7 @@ const deserializeAws_json1_1DescribeProductViewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3217,7 +3217,7 @@ const deserializeAws_json1_1DescribeProvisionedProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3261,7 +3261,7 @@ const deserializeAws_json1_1DescribeProvisionedProductPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3305,7 +3305,7 @@ const deserializeAws_json1_1DescribeProvisioningArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3349,7 +3349,7 @@ const deserializeAws_json1_1DescribeProvisioningParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3393,7 +3393,7 @@ const deserializeAws_json1_1DescribeRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3434,7 +3434,7 @@ const deserializeAws_json1_1DescribeServiceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3475,7 +3475,7 @@ const deserializeAws_json1_1DescribeServiceActionExecutionParametersCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3519,7 +3519,7 @@ const deserializeAws_json1_1DescribeTagOptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3563,7 +3563,7 @@ const deserializeAws_json1_1DisableAWSOrganizationsAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3610,7 +3610,7 @@ const deserializeAws_json1_1DisassociateBudgetFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3651,7 +3651,7 @@ const deserializeAws_json1_1DisassociatePrincipalFromPortfolioCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3695,7 +3695,7 @@ const deserializeAws_json1_1DisassociateProductFromPortfolioCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3742,7 +3742,7 @@ const deserializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactCom ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3783,7 +3783,7 @@ const deserializeAws_json1_1DisassociateTagOptionFromResourceCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3827,7 +3827,7 @@ const deserializeAws_json1_1EnableAWSOrganizationsAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3874,7 +3874,7 @@ const deserializeAws_json1_1ExecuteProvisionedProductPlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3921,7 +3921,7 @@ const deserializeAws_json1_1ExecuteProvisionedProductServiceActionCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3968,7 +3968,7 @@ const deserializeAws_json1_1GetAWSOrganizationsAccessStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4012,7 +4012,7 @@ const deserializeAws_json1_1GetProvisionedProductOutputsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4056,7 +4056,7 @@ const deserializeAws_json1_1ImportAsProvisionedProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4106,7 +4106,7 @@ const deserializeAws_json1_1ListAcceptedPortfolioSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4150,7 +4150,7 @@ const deserializeAws_json1_1ListBudgetsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4194,7 +4194,7 @@ const deserializeAws_json1_1ListConstraintsForPortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4238,7 +4238,7 @@ const deserializeAws_json1_1ListLaunchPathsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4282,7 +4282,7 @@ const deserializeAws_json1_1ListOrganizationPortfolioAccessCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4329,7 +4329,7 @@ const deserializeAws_json1_1ListPortfolioAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4373,7 +4373,7 @@ const deserializeAws_json1_1ListPortfoliosCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4414,7 +4414,7 @@ const deserializeAws_json1_1ListPortfoliosForProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4458,7 +4458,7 @@ const deserializeAws_json1_1ListPrincipalsForPortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4502,7 +4502,7 @@ const deserializeAws_json1_1ListProvisionedProductPlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4546,7 +4546,7 @@ const deserializeAws_json1_1ListProvisioningArtifactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4590,7 +4590,7 @@ const deserializeAws_json1_1ListProvisioningArtifactsForServiceActionCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4634,7 +4634,7 @@ const deserializeAws_json1_1ListRecordHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4675,7 +4675,7 @@ const deserializeAws_json1_1ListResourcesForTagOptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4722,7 +4722,7 @@ const deserializeAws_json1_1ListServiceActionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4763,7 +4763,7 @@ const deserializeAws_json1_1ListServiceActionsForProvisioningArtifactCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4807,7 +4807,7 @@ const deserializeAws_json1_1ListStackInstancesForProvisionedProductCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4851,7 +4851,7 @@ const deserializeAws_json1_1ListTagOptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4895,7 +4895,7 @@ const deserializeAws_json1_1ProvisionProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4942,7 +4942,7 @@ const deserializeAws_json1_1RejectPortfolioShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4983,7 +4983,7 @@ const deserializeAws_json1_1ScanProvisionedProductsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5024,7 +5024,7 @@ const deserializeAws_json1_1SearchProductsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5065,7 +5065,7 @@ const deserializeAws_json1_1SearchProductsAsAdminCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5109,7 +5109,7 @@ const deserializeAws_json1_1SearchProvisionedProductsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5150,7 +5150,7 @@ const deserializeAws_json1_1TerminateProvisionedProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5191,7 +5191,7 @@ const deserializeAws_json1_1UpdateConstraintCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5235,7 +5235,7 @@ const deserializeAws_json1_1UpdatePortfolioCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5285,7 +5285,7 @@ const deserializeAws_json1_1UpdatePortfolioShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5335,7 +5335,7 @@ const deserializeAws_json1_1UpdateProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5382,7 +5382,7 @@ const deserializeAws_json1_1UpdateProvisionedProductCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5426,7 +5426,7 @@ const deserializeAws_json1_1UpdateProvisionedProductPropertiesCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5473,7 +5473,7 @@ const deserializeAws_json1_1UpdateProvisioningArtifactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5517,7 +5517,7 @@ const deserializeAws_json1_1UpdateServiceActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5561,7 +5561,7 @@ const deserializeAws_json1_1UpdateTagOptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9414,6 +9414,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts index b84fd5413a7b..430fee3160db 100644 --- a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts @@ -417,7 +417,7 @@ const deserializeAws_json1_1AssociateServiceQuotaTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -479,7 +479,7 @@ const deserializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -544,7 +544,7 @@ const deserializeAws_json1_1DisassociateServiceQuotaTemplateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -606,7 +606,7 @@ const deserializeAws_json1_1GetAssociationForServiceQuotaTemplateCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -668,7 +668,7 @@ const deserializeAws_json1_1GetAWSDefaultServiceQuotaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -721,7 +721,7 @@ const deserializeAws_json1_1GetRequestedServiceQuotaChangeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -774,7 +774,7 @@ const deserializeAws_json1_1GetServiceQuotaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -827,7 +827,7 @@ const deserializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -892,7 +892,7 @@ const deserializeAws_json1_1ListAWSDefaultServiceQuotasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -948,7 +948,7 @@ const deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1004,7 +1004,7 @@ const deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaCommand ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1060,7 +1060,7 @@ const deserializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1122,7 +1122,7 @@ const deserializeAws_json1_1ListServiceQuotasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1178,7 +1178,7 @@ const deserializeAws_json1_1ListServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1231,7 +1231,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1284,7 +1284,7 @@ const deserializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1352,7 +1352,7 @@ const deserializeAws_json1_1RequestServiceQuotaIncreaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1417,7 +1417,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1476,7 +1476,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2496,6 +2496,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts index 28bac876ae47..0f2383c508a1 100644 --- a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts @@ -549,7 +549,7 @@ const deserializeAws_json1_1CreateHttpNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -602,7 +602,7 @@ const deserializeAws_json1_1CreatePrivateDnsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -655,7 +655,7 @@ const deserializeAws_json1_1CreatePublicDnsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -708,7 +708,7 @@ const deserializeAws_json1_1CreateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -761,7 +761,7 @@ const deserializeAws_json1_1DeleteNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -811,7 +811,7 @@ const deserializeAws_json1_1DeleteServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -858,7 +858,7 @@ const deserializeAws_json1_1DeregisterInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -911,7 +911,7 @@ const deserializeAws_json1_1DiscoverInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -961,7 +961,7 @@ const deserializeAws_json1_1GetInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1008,7 +1008,7 @@ const deserializeAws_json1_1GetInstancesHealthStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1055,7 +1055,7 @@ const deserializeAws_json1_1GetNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1099,7 +1099,7 @@ const deserializeAws_json1_1GetOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1143,7 +1143,7 @@ const deserializeAws_json1_1GetServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1187,7 +1187,7 @@ const deserializeAws_json1_1ListInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1231,7 +1231,7 @@ const deserializeAws_json1_1ListNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1272,7 +1272,7 @@ const deserializeAws_json1_1ListOperationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1313,7 +1313,7 @@ const deserializeAws_json1_1ListServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1354,7 +1354,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1398,7 +1398,7 @@ const deserializeAws_json1_1RegisterInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1451,7 +1451,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1498,7 +1498,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1542,7 +1542,7 @@ const deserializeAws_json1_1UpdateHttpNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1589,7 +1589,7 @@ const deserializeAws_json1_1UpdateInstanceCustomHealthStatusCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1639,7 +1639,7 @@ const deserializeAws_json1_1UpdatePrivateDnsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1689,7 +1689,7 @@ const deserializeAws_json1_1UpdatePublicDnsNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1739,7 +1739,7 @@ const deserializeAws_json1_1UpdateServiceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3128,6 +3128,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ses/src/protocols/Aws_query.ts b/clients/client-ses/src/protocols/Aws_query.ts index 59a57993fcf9..c0bcda78c93c 100644 --- a/clients/client-ses/src/protocols/Aws_query.ts +++ b/clients/client-ses/src/protocols/Aws_query.ts @@ -1605,7 +1605,7 @@ const deserializeAws_queryCloneReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1652,7 +1652,7 @@ const deserializeAws_queryCreateConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1702,7 +1702,7 @@ const deserializeAws_queryCreateConfigurationSetEventDestinationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1761,7 +1761,7 @@ const deserializeAws_queryCreateConfigurationSetTrackingOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1805,7 +1805,7 @@ const deserializeAws_queryCreateCustomVerificationEmailTemplateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1858,7 +1858,7 @@ const deserializeAws_queryCreateReceiptFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1902,7 +1902,7 @@ const deserializeAws_queryCreateReceiptRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1961,7 +1961,7 @@ const deserializeAws_queryCreateReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2005,7 +2005,7 @@ const deserializeAws_queryCreateTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2052,7 +2052,7 @@ const deserializeAws_queryDeleteConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2096,7 +2096,7 @@ const deserializeAws_queryDeleteConfigurationSetEventDestinationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2143,7 +2143,7 @@ const deserializeAws_queryDeleteConfigurationSetTrackingOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2184,7 +2184,7 @@ const deserializeAws_queryDeleteCustomVerificationEmailTemplateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2219,7 +2219,7 @@ const deserializeAws_queryDeleteIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2254,7 +2254,7 @@ const deserializeAws_queryDeleteIdentityPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2289,7 +2289,7 @@ const deserializeAws_queryDeleteReceiptFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2324,7 +2324,7 @@ const deserializeAws_queryDeleteReceiptRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2365,7 +2365,7 @@ const deserializeAws_queryDeleteReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2406,7 +2406,7 @@ const deserializeAws_queryDeleteTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2438,7 +2438,7 @@ const deserializeAws_queryDeleteVerifiedEmailAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2473,7 +2473,7 @@ const deserializeAws_queryDescribeActiveReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2508,7 +2508,7 @@ const deserializeAws_queryDescribeConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2549,7 +2549,7 @@ const deserializeAws_queryDescribeReceiptRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2593,7 +2593,7 @@ const deserializeAws_queryDescribeReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2634,7 +2634,7 @@ const deserializeAws_queryGetAccountSendingEnabledCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2672,7 +2672,7 @@ const deserializeAws_queryGetCustomVerificationEmailTemplateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2716,7 +2716,7 @@ const deserializeAws_queryGetIdentityDkimAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2754,7 +2754,7 @@ const deserializeAws_queryGetIdentityMailFromDomainAttributesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2792,7 +2792,7 @@ const deserializeAws_queryGetIdentityNotificationAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2827,7 +2827,7 @@ const deserializeAws_queryGetIdentityPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2865,7 +2865,7 @@ const deserializeAws_queryGetIdentityVerificationAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2900,7 +2900,7 @@ const deserializeAws_queryGetSendQuotaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2935,7 +2935,7 @@ const deserializeAws_queryGetSendStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2970,7 +2970,7 @@ const deserializeAws_queryGetTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3011,7 +3011,7 @@ const deserializeAws_queryListConfigurationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3049,7 +3049,7 @@ const deserializeAws_queryListCustomVerificationEmailTemplatesCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3084,7 +3084,7 @@ const deserializeAws_queryListIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3119,7 +3119,7 @@ const deserializeAws_queryListIdentityPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3154,7 +3154,7 @@ const deserializeAws_queryListReceiptFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3189,7 +3189,7 @@ const deserializeAws_queryListReceiptRuleSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3224,7 +3224,7 @@ const deserializeAws_queryListTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3259,7 +3259,7 @@ const deserializeAws_queryListVerifiedEmailAddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3297,7 +3297,7 @@ const deserializeAws_queryPutConfigurationSetDeliveryOptionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3341,7 +3341,7 @@ const deserializeAws_queryPutIdentityPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3382,7 +3382,7 @@ const deserializeAws_queryReorderReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3426,7 +3426,7 @@ const deserializeAws_querySendBounceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3467,7 +3467,7 @@ const deserializeAws_querySendBulkTemplatedEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3523,7 +3523,7 @@ const deserializeAws_querySendCustomVerificationEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3579,7 +3579,7 @@ const deserializeAws_querySendEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3632,7 +3632,7 @@ const deserializeAws_querySendRawEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3685,7 +3685,7 @@ const deserializeAws_querySendTemplatedEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3741,7 +3741,7 @@ const deserializeAws_querySetActiveReceiptRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3782,7 +3782,7 @@ const deserializeAws_querySetIdentityDkimEnabledCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3820,7 +3820,7 @@ const deserializeAws_querySetIdentityFeedbackForwardingEnabledCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3858,7 +3858,7 @@ const deserializeAws_querySetIdentityHeadersInNotificationsEnabledCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3893,7 +3893,7 @@ const deserializeAws_querySetIdentityMailFromDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3928,7 +3928,7 @@ const deserializeAws_querySetIdentityNotificationTopicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3963,7 +3963,7 @@ const deserializeAws_querySetReceiptRulePositionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4007,7 +4007,7 @@ const deserializeAws_queryTestRenderTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4051,7 +4051,7 @@ const deserializeAws_queryUpdateAccountSendingEnabledCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4089,7 +4089,7 @@ const deserializeAws_queryUpdateConfigurationSetEventDestinationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4139,7 +4139,7 @@ const deserializeAws_queryUpdateConfigurationSetReputationMetricsEnabledCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4177,7 +4177,7 @@ const deserializeAws_queryUpdateConfigurationSetSendingEnabledCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4221,7 +4221,7 @@ const deserializeAws_queryUpdateConfigurationSetTrackingOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4265,7 +4265,7 @@ const deserializeAws_queryUpdateCustomVerificationEmailTemplateCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4315,7 +4315,7 @@ const deserializeAws_queryUpdateReceiptRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4371,7 +4371,7 @@ const deserializeAws_queryUpdateTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4415,7 +4415,7 @@ const deserializeAws_queryVerifyDomainDkimCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4450,7 +4450,7 @@ const deserializeAws_queryVerifyDomainIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4482,7 +4482,7 @@ const deserializeAws_queryVerifyEmailAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4517,7 +4517,7 @@ const deserializeAws_queryVerifyEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -9016,6 +9016,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-sesv2/src/protocols/Aws_restJson1.ts b/clients/client-sesv2/src/protocols/Aws_restJson1.ts index 00fc81f514a8..81c62d5e9983 100644 --- a/clients/client-sesv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-sesv2/src/protocols/Aws_restJson1.ts @@ -2837,7 +2837,7 @@ const deserializeAws_restJson1CreateConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2890,7 +2890,7 @@ const deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2940,7 +2940,7 @@ const deserializeAws_restJson1CreateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2987,7 +2987,7 @@ const deserializeAws_restJson1CreateContactListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3034,7 +3034,7 @@ const deserializeAws_restJson1CreateCustomVerificationEmailTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3084,7 +3084,7 @@ const deserializeAws_restJson1CreateDedicatedIpPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3140,7 +3140,7 @@ const deserializeAws_restJson1CreateDeliverabilityTestReportCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3211,7 +3211,7 @@ const deserializeAws_restJson1CreateEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3264,7 +3264,7 @@ const deserializeAws_restJson1CreateEmailIdentityPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3314,7 +3314,7 @@ const deserializeAws_restJson1CreateEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3364,7 +3364,7 @@ const deserializeAws_restJson1CreateImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3408,7 +3408,7 @@ const deserializeAws_restJson1DeleteConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3455,7 +3455,7 @@ const deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3499,7 +3499,7 @@ const deserializeAws_restJson1DeleteContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3543,7 +3543,7 @@ const deserializeAws_restJson1DeleteContactListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3590,7 +3590,7 @@ const deserializeAws_restJson1DeleteCustomVerificationEmailTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3634,7 +3634,7 @@ const deserializeAws_restJson1DeleteDedicatedIpPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3681,7 +3681,7 @@ const deserializeAws_restJson1DeleteEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3728,7 +3728,7 @@ const deserializeAws_restJson1DeleteEmailIdentityPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3772,7 +3772,7 @@ const deserializeAws_restJson1DeleteEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3816,7 +3816,7 @@ const deserializeAws_restJson1DeleteSuppressedDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3881,7 +3881,7 @@ const deserializeAws_restJson1GetAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3925,7 +3925,7 @@ const deserializeAws_restJson1GetBlacklistReportsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3990,7 +3990,7 @@ const deserializeAws_restJson1GetConfigurationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4037,7 +4037,7 @@ const deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4108,7 +4108,7 @@ const deserializeAws_restJson1GetContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4170,7 +4170,7 @@ const deserializeAws_restJson1GetContactListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4232,7 +4232,7 @@ const deserializeAws_restJson1GetCustomVerificationEmailTemplateCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4279,7 +4279,7 @@ const deserializeAws_restJson1GetDedicatedIpCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4329,7 +4329,7 @@ const deserializeAws_restJson1GetDedicatedIpsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4396,7 +4396,7 @@ const deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4458,7 +4458,7 @@ const deserializeAws_restJson1GetDeliverabilityTestReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4508,7 +4508,7 @@ const deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4558,7 +4558,7 @@ const deserializeAws_restJson1GetDomainStatisticsReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4626,7 +4626,7 @@ const deserializeAws_restJson1GetEmailIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4673,7 +4673,7 @@ const deserializeAws_restJson1GetEmailIdentityPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4723,7 +4723,7 @@ const deserializeAws_restJson1GetEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4794,7 +4794,7 @@ const deserializeAws_restJson1GetImportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4841,7 +4841,7 @@ const deserializeAws_restJson1GetSuppressedDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4891,7 +4891,7 @@ const deserializeAws_restJson1ListConfigurationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4938,7 +4938,7 @@ const deserializeAws_restJson1ListContactListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4985,7 +4985,7 @@ const deserializeAws_restJson1ListContactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5038,7 +5038,7 @@ const deserializeAws_restJson1ListCustomVerificationEmailTemplatesCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5085,7 +5085,7 @@ const deserializeAws_restJson1ListDedicatedIpPoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5135,7 +5135,7 @@ const deserializeAws_restJson1ListDeliverabilityTestReportsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5188,7 +5188,7 @@ const deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5238,7 +5238,7 @@ const deserializeAws_restJson1ListEmailIdentitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5285,7 +5285,7 @@ const deserializeAws_restJson1ListEmailTemplatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5332,7 +5332,7 @@ const deserializeAws_restJson1ListImportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5382,7 +5382,7 @@ const deserializeAws_restJson1ListSuppressedDestinationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5429,7 +5429,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5473,7 +5473,7 @@ const deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5514,7 +5514,7 @@ const deserializeAws_restJson1PutAccountDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5558,7 +5558,7 @@ const deserializeAws_restJson1PutAccountSendingAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5599,7 +5599,7 @@ const deserializeAws_restJson1PutAccountSuppressionAttributesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5640,7 +5640,7 @@ const deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5684,7 +5684,7 @@ const deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5728,7 +5728,7 @@ const deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5772,7 +5772,7 @@ const deserializeAws_restJson1PutConfigurationSetSuppressionOptionsCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5816,7 +5816,7 @@ const deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5860,7 +5860,7 @@ const deserializeAws_restJson1PutDedicatedIpInPoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5904,7 +5904,7 @@ const deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5948,7 +5948,7 @@ const deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5998,7 +5998,7 @@ const deserializeAws_restJson1PutEmailIdentityConfigurationSetAttributesCommandE ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6042,7 +6042,7 @@ const deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6092,7 +6092,7 @@ const deserializeAws_restJson1PutEmailIdentityDkimSigningAttributesCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6136,7 +6136,7 @@ const deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6180,7 +6180,7 @@ const deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6224,7 +6224,7 @@ const deserializeAws_restJson1PutSuppressedDestinationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6271,7 +6271,7 @@ const deserializeAws_restJson1SendBulkEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6333,7 +6333,7 @@ const deserializeAws_restJson1SendCustomVerificationEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6392,7 +6392,7 @@ const deserializeAws_restJson1SendEmailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6451,7 +6451,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6501,7 +6501,7 @@ const deserializeAws_restJson1TestRenderEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6545,7 +6545,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6592,7 +6592,7 @@ const deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6636,7 +6636,7 @@ const deserializeAws_restJson1UpdateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6683,7 +6683,7 @@ const deserializeAws_restJson1UpdateContactListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6730,7 +6730,7 @@ const deserializeAws_restJson1UpdateCustomVerificationEmailTemplateCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6774,7 +6774,7 @@ const deserializeAws_restJson1UpdateEmailIdentityPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6818,7 +6818,7 @@ const deserializeAws_restJson1UpdateEmailTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8448,6 +8448,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sfn/src/protocols/Aws_json1_0.ts b/clients/client-sfn/src/protocols/Aws_json1_0.ts index 8424af44b7a4..2cf1280f9825 100644 --- a/clients/client-sfn/src/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/src/protocols/Aws_json1_0.ts @@ -501,7 +501,7 @@ const deserializeAws_json1_0CreateActivityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -548,7 +548,7 @@ const deserializeAws_json1_0CreateStateMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -616,7 +616,7 @@ const deserializeAws_json1_0DeleteActivityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -657,7 +657,7 @@ const deserializeAws_json1_0DeleteStateMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -698,7 +698,7 @@ const deserializeAws_json1_0DescribeActivityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -742,7 +742,7 @@ const deserializeAws_json1_0DescribeExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -786,7 +786,7 @@ const deserializeAws_json1_0DescribeStateMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -830,7 +830,7 @@ const deserializeAws_json1_0DescribeStateMachineForExecutionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -874,7 +874,7 @@ const deserializeAws_json1_0GetActivityTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -921,7 +921,7 @@ const deserializeAws_json1_0GetExecutionHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -968,7 +968,7 @@ const deserializeAws_json1_0ListActivitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1009,7 +1009,7 @@ const deserializeAws_json1_0ListExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_json1_0ListStateMachinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1100,7 +1100,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1144,7 +1144,7 @@ const deserializeAws_json1_0SendTaskFailureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1191,7 +1191,7 @@ const deserializeAws_json1_0SendTaskHeartbeatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1238,7 +1238,7 @@ const deserializeAws_json1_0SendTaskSuccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1288,7 +1288,7 @@ const deserializeAws_json1_0StartExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1347,7 +1347,7 @@ const deserializeAws_json1_0StartSyncExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1403,7 +1403,7 @@ const deserializeAws_json1_0StopExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1447,7 +1447,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1494,7 +1494,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_json1_0UpdateStateMachineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3264,6 +3264,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-shield/src/protocols/Aws_json1_1.ts b/clients/client-shield/src/protocols/Aws_json1_1.ts index abe4ac4f4c8e..bd534163c0fd 100644 --- a/clients/client-shield/src/protocols/Aws_json1_1.ts +++ b/clients/client-shield/src/protocols/Aws_json1_1.ts @@ -737,7 +737,7 @@ const deserializeAws_json1_1AssociateDRTLogBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -799,7 +799,7 @@ const deserializeAws_json1_1AssociateDRTRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -855,7 +855,7 @@ const deserializeAws_json1_1AssociateHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -911,7 +911,7 @@ const deserializeAws_json1_1AssociateProactiveEngagementDetailsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -964,7 +964,7 @@ const deserializeAws_json1_1CreateProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1026,7 +1026,7 @@ const deserializeAws_json1_1CreateProtectionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1082,7 +1082,7 @@ const deserializeAws_json1_1CreateSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1126,7 +1126,7 @@ const deserializeAws_json1_1DeleteProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1173,7 +1173,7 @@ const deserializeAws_json1_1DeleteProtectionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1220,7 +1220,7 @@ const deserializeAws_json1_1DeleteSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1267,7 +1267,7 @@ const deserializeAws_json1_1DescribeAttackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1311,7 +1311,7 @@ const deserializeAws_json1_1DescribeAttackStatisticsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1352,7 +1352,7 @@ const deserializeAws_json1_1DescribeDRTAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1396,7 +1396,7 @@ const deserializeAws_json1_1DescribeEmergencyContactSettingsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1440,7 +1440,7 @@ const deserializeAws_json1_1DescribeProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1487,7 +1487,7 @@ const deserializeAws_json1_1DescribeProtectionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1531,7 +1531,7 @@ const deserializeAws_json1_1DescribeSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1575,7 +1575,7 @@ const deserializeAws_json1_1DisableApplicationLayerAutomaticResponseCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1628,7 +1628,7 @@ const deserializeAws_json1_1DisableProactiveEngagementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1681,7 +1681,7 @@ const deserializeAws_json1_1DisassociateDRTLogBucketCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1737,7 +1737,7 @@ const deserializeAws_json1_1DisassociateDRTRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1787,7 +1787,7 @@ const deserializeAws_json1_1DisassociateHealthCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_json1_1EnableApplicationLayerAutomaticResponseCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1896,7 +1896,7 @@ const deserializeAws_json1_1EnableProactiveEngagementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1949,7 +1949,7 @@ const deserializeAws_json1_1GetSubscriptionStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1990,7 +1990,7 @@ const deserializeAws_json1_1ListAttacksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2037,7 +2037,7 @@ const deserializeAws_json1_1ListProtectionGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2084,7 +2084,7 @@ const deserializeAws_json1_1ListProtectionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2131,7 +2131,7 @@ const deserializeAws_json1_1ListResourcesInProtectionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2178,7 +2178,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2225,7 +2225,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2325,7 +2325,7 @@ const deserializeAws_json1_1UpdateApplicationLayerAutomaticResponseCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2378,7 +2378,7 @@ const deserializeAws_json1_1UpdateEmergencyContactSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2428,7 +2428,7 @@ const deserializeAws_json1_1UpdateProtectionGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2478,7 +2478,7 @@ const deserializeAws_json1_1UpdateSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4180,6 +4180,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-signer/src/protocols/Aws_restJson1.ts b/clients/client-signer/src/protocols/Aws_restJson1.ts index d80d3f34f8bd..42582a6d3830 100644 --- a/clients/client-signer/src/protocols/Aws_restJson1.ts +++ b/clients/client-signer/src/protocols/Aws_restJson1.ts @@ -575,7 +575,7 @@ const deserializeAws_restJson1AddProfilePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -631,7 +631,7 @@ const deserializeAws_restJson1CancelSigningProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -735,7 +735,7 @@ const deserializeAws_restJson1DescribeSigningJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -809,7 +809,7 @@ const deserializeAws_restJson1GetSigningPlatformCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -901,7 +901,7 @@ const deserializeAws_restJson1GetSigningProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -960,7 +960,7 @@ const deserializeAws_restJson1ListProfilePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1016,7 +1016,7 @@ const deserializeAws_restJson1ListSigningJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1069,7 +1069,7 @@ const deserializeAws_restJson1ListSigningPlatformsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1122,7 +1122,7 @@ const deserializeAws_restJson1ListSigningProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1169,7 +1169,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1225,7 +1225,7 @@ const deserializeAws_restJson1PutSigningProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1278,7 +1278,7 @@ const deserializeAws_restJson1RemoveProfilePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1331,7 +1331,7 @@ const deserializeAws_restJson1RevokeSignatureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1381,7 +1381,7 @@ const deserializeAws_restJson1RevokeSigningProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1437,7 +1437,7 @@ const deserializeAws_restJson1StartSigningJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1490,7 +1490,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1537,7 +1537,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2207,6 +2207,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sms/src/protocols/Aws_json1_1.ts b/clients/client-sms/src/protocols/Aws_json1_1.ts index 77dea8937a85..a0622846c5a7 100644 --- a/clients/client-sms/src/protocols/Aws_json1_1.ts +++ b/clients/client-sms/src/protocols/Aws_json1_1.ts @@ -706,7 +706,7 @@ const deserializeAws_json1_1CreateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -759,7 +759,7 @@ const deserializeAws_json1_1CreateReplicationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -824,7 +824,7 @@ const deserializeAws_json1_1DeleteAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -877,7 +877,7 @@ const deserializeAws_json1_1DeleteAppLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -930,7 +930,7 @@ const deserializeAws_json1_1DeleteAppReplicationConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -983,7 +983,7 @@ const deserializeAws_json1_1DeleteAppValidationConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1036,7 +1036,7 @@ const deserializeAws_json1_1DeleteReplicationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1089,7 +1089,7 @@ const deserializeAws_json1_1DeleteServerCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1139,7 +1139,7 @@ const deserializeAws_json1_1DisassociateConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1189,7 +1189,7 @@ const deserializeAws_json1_1GenerateChangeSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1242,7 +1242,7 @@ const deserializeAws_json1_1GenerateTemplateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1295,7 +1295,7 @@ const deserializeAws_json1_1GetAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1348,7 +1348,7 @@ const deserializeAws_json1_1GetAppLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1401,7 +1401,7 @@ const deserializeAws_json1_1GetAppReplicationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1454,7 +1454,7 @@ const deserializeAws_json1_1GetAppValidationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1507,7 +1507,7 @@ const deserializeAws_json1_1GetAppValidationOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1560,7 +1560,7 @@ const deserializeAws_json1_1GetConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1601,7 +1601,7 @@ const deserializeAws_json1_1GetReplicationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1648,7 +1648,7 @@ const deserializeAws_json1_1GetReplicationRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1695,7 +1695,7 @@ const deserializeAws_json1_1GetServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1745,7 +1745,7 @@ const deserializeAws_json1_1ImportAppCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1798,7 +1798,7 @@ const deserializeAws_json1_1ImportServerCatalogCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1851,7 +1851,7 @@ const deserializeAws_json1_1LaunchAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1904,7 +1904,7 @@ const deserializeAws_json1_1ListAppsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1957,7 +1957,7 @@ const deserializeAws_json1_1NotifyAppValidationOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2010,7 +2010,7 @@ const deserializeAws_json1_1PutAppLaunchConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2063,7 +2063,7 @@ const deserializeAws_json1_1PutAppReplicationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2116,7 +2116,7 @@ const deserializeAws_json1_1PutAppValidationConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2169,7 +2169,7 @@ const deserializeAws_json1_1StartAppReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2222,7 +2222,7 @@ const deserializeAws_json1_1StartOnDemandAppReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2275,7 +2275,7 @@ const deserializeAws_json1_1StartOnDemandReplicationRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2331,7 +2331,7 @@ const deserializeAws_json1_1StopAppReplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,7 +2384,7 @@ const deserializeAws_json1_1TerminateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2437,7 +2437,7 @@ const deserializeAws_json1_1UpdateAppCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2490,7 +2490,7 @@ const deserializeAws_json1_1UpdateReplicationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4431,6 +4431,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts index 8a2b67356ee2..657fbe279655 100644 --- a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts +++ b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts @@ -437,7 +437,7 @@ const deserializeAws_restJson1CancelTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -493,7 +493,7 @@ const deserializeAws_restJson1CreateTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -582,7 +582,7 @@ const deserializeAws_restJson1DescribeDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -635,7 +635,7 @@ const deserializeAws_restJson1DescribeDeviceEc2InstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -703,7 +703,7 @@ const deserializeAws_restJson1DescribeExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -780,7 +780,7 @@ const deserializeAws_restJson1DescribeTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -836,7 +836,7 @@ const deserializeAws_restJson1ListDeviceResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -892,7 +892,7 @@ const deserializeAws_restJson1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -945,7 +945,7 @@ const deserializeAws_restJson1ListExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -998,7 +998,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1048,7 +1048,7 @@ const deserializeAws_restJson1ListTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1095,7 +1095,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1139,7 +1139,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1630,6 +1630,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-snowball/src/protocols/Aws_json1_1.ts b/clients/client-snowball/src/protocols/Aws_json1_1.ts index 65a1d96b0ef4..bba483f407c6 100644 --- a/clients/client-snowball/src/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/src/protocols/Aws_json1_1.ts @@ -505,7 +505,7 @@ const deserializeAws_json1_1CancelClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -552,7 +552,7 @@ const deserializeAws_json1_1CancelJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -599,7 +599,7 @@ const deserializeAws_json1_1CreateAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -643,7 +643,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -693,7 +693,7 @@ const deserializeAws_json1_1CreateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -746,7 +746,7 @@ const deserializeAws_json1_1CreateLongTermPricingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -787,7 +787,7 @@ const deserializeAws_json1_1CreateReturnShippingLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -840,7 +840,7 @@ const deserializeAws_json1_1DescribeAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -881,7 +881,7 @@ const deserializeAws_json1_1DescribeAddressesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_json1_1DescribeClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -966,7 +966,7 @@ const deserializeAws_json1_1DescribeJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1007,7 +1007,7 @@ const deserializeAws_json1_1DescribeReturnShippingLabelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1054,7 +1054,7 @@ const deserializeAws_json1_1GetJobManifestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1098,7 +1098,7 @@ const deserializeAws_json1_1GetJobUnlockCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1142,7 +1142,7 @@ const deserializeAws_json1_1GetSnowballUsageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1177,7 +1177,7 @@ const deserializeAws_json1_1GetSoftwareUpdatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1221,7 +1221,7 @@ const deserializeAws_json1_1ListClusterJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1265,7 +1265,7 @@ const deserializeAws_json1_1ListClustersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1306,7 +1306,7 @@ const deserializeAws_json1_1ListCompatibleImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1350,7 +1350,7 @@ const deserializeAws_json1_1ListJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1391,7 +1391,7 @@ const deserializeAws_json1_1ListLongTermPricingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1435,7 +1435,7 @@ const deserializeAws_json1_1UpdateClusterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1488,7 +1488,7 @@ const deserializeAws_json1_1UpdateJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1544,7 +1544,7 @@ const deserializeAws_json1_1UpdateJobShipmentStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1588,7 +1588,7 @@ const deserializeAws_json1_1UpdateLongTermPricingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3067,6 +3067,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sns/src/protocols/Aws_query.ts b/clients/client-sns/src/protocols/Aws_query.ts index bc504235f293..87b54962f7ee 100644 --- a/clients/client-sns/src/protocols/Aws_query.ts +++ b/clients/client-sns/src/protocols/Aws_query.ts @@ -947,7 +947,7 @@ const deserializeAws_queryAddPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -997,7 +997,7 @@ const deserializeAws_queryCheckIfPhoneNumberIsOptedOutCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1047,7 +1047,7 @@ const deserializeAws_queryConfirmSubscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1103,7 +1103,7 @@ const deserializeAws_queryCreatePlatformApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1150,7 +1150,7 @@ const deserializeAws_queryCreatePlatformEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1200,7 +1200,7 @@ const deserializeAws_queryCreateSMSSandboxPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1256,7 +1256,7 @@ const deserializeAws_queryCreateTopicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1318,7 +1318,7 @@ const deserializeAws_queryDeleteEndpointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1362,7 +1362,7 @@ const deserializeAws_queryDeletePlatformApplicationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1409,7 +1409,7 @@ const deserializeAws_queryDeleteSMSSandboxPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1462,7 +1462,7 @@ const deserializeAws_queryDeleteTopicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1521,7 +1521,7 @@ const deserializeAws_queryGetDataProtectionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1574,7 +1574,7 @@ const deserializeAws_queryGetEndpointAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1627,7 +1627,7 @@ const deserializeAws_queryGetPlatformApplicationAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1677,7 +1677,7 @@ const deserializeAws_queryGetSMSAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1727,7 +1727,7 @@ const deserializeAws_queryGetSMSSandboxAccountStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1774,7 +1774,7 @@ const deserializeAws_queryGetSubscriptionAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1824,7 +1824,7 @@ const deserializeAws_queryGetTopicAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1880,7 +1880,7 @@ const deserializeAws_queryListEndpointsByPlatformApplicationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1930,7 +1930,7 @@ const deserializeAws_queryListOriginationNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1983,7 +1983,7 @@ const deserializeAws_queryListPhoneNumbersOptedOutCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2033,7 +2033,7 @@ const deserializeAws_queryListPlatformApplicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2080,7 +2080,7 @@ const deserializeAws_queryListSMSSandboxPhoneNumbersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2133,7 +2133,7 @@ const deserializeAws_queryListSubscriptionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2180,7 +2180,7 @@ const deserializeAws_queryListSubscriptionsByTopicCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2230,7 +2230,7 @@ const deserializeAws_queryListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2283,7 +2283,7 @@ const deserializeAws_queryListTopicsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2330,7 +2330,7 @@ const deserializeAws_queryOptInPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2380,7 +2380,7 @@ const deserializeAws_queryPublishCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2463,7 +2463,7 @@ const deserializeAws_queryPublishBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2558,7 +2558,7 @@ const deserializeAws_queryPutDataProtectionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2608,7 +2608,7 @@ const deserializeAws_queryRemovePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2655,7 +2655,7 @@ const deserializeAws_querySetEndpointAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2702,7 +2702,7 @@ const deserializeAws_querySetPlatformApplicationAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2752,7 +2752,7 @@ const deserializeAws_querySetSMSAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2799,7 +2799,7 @@ const deserializeAws_querySetSubscriptionAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2849,7 +2849,7 @@ const deserializeAws_querySetTopicAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2902,7 +2902,7 @@ const deserializeAws_querySubscribeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2961,7 +2961,7 @@ const deserializeAws_queryTagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3017,7 +3017,7 @@ const deserializeAws_queryUnsubscribeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3070,7 +3070,7 @@ const deserializeAws_queryUntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3129,7 +3129,7 @@ const deserializeAws_queryVerifySMSSandboxPhoneNumberCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5593,6 +5593,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-sqs/src/protocols/Aws_query.ts b/clients/client-sqs/src/protocols/Aws_query.ts index d1e7428dec96..9c67b872b196 100644 --- a/clients/client-sqs/src/protocols/Aws_query.ts +++ b/clients/client-sqs/src/protocols/Aws_query.ts @@ -449,7 +449,7 @@ const deserializeAws_queryAddPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -487,7 +487,7 @@ const deserializeAws_queryChangeMessageVisibilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -531,7 +531,7 @@ const deserializeAws_queryChangeMessageVisibilityBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -581,7 +581,7 @@ const deserializeAws_queryCreateQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -622,7 +622,7 @@ const deserializeAws_queryDeleteMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -666,7 +666,7 @@ const deserializeAws_queryDeleteMessageBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -713,7 +713,7 @@ const deserializeAws_queryDeleteQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -748,7 +748,7 @@ const deserializeAws_queryGetQueueAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -789,7 +789,7 @@ const deserializeAws_queryGetQueueUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -830,7 +830,7 @@ const deserializeAws_queryListDeadLetterSourceQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -871,7 +871,7 @@ const deserializeAws_queryListQueuesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -906,7 +906,7 @@ const deserializeAws_queryListQueueTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -938,7 +938,7 @@ const deserializeAws_queryPurgeQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -982,7 +982,7 @@ const deserializeAws_queryReceiveMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1020,7 +1020,7 @@ const deserializeAws_queryRemovePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1055,7 +1055,7 @@ const deserializeAws_querySendMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1099,7 +1099,7 @@ const deserializeAws_querySendMessageBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1152,7 +1152,7 @@ const deserializeAws_querySetQueueAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1190,7 +1190,7 @@ const deserializeAws_queryTagQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1222,7 +1222,7 @@ const deserializeAws_queryUntagQueueCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2759,6 +2759,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts index ff051003834e..d06cb552c3b9 100644 --- a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts @@ -523,7 +523,7 @@ const deserializeAws_json1_1AcceptPageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -576,7 +576,7 @@ const deserializeAws_json1_1ActivateContactChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -629,7 +629,7 @@ const deserializeAws_json1_1CreateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -688,7 +688,7 @@ const deserializeAws_json1_1CreateContactChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -744,7 +744,7 @@ const deserializeAws_json1_1DeactivateContactChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -797,7 +797,7 @@ const deserializeAws_json1_1DeleteContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -850,7 +850,7 @@ const deserializeAws_json1_1DeleteContactChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -903,7 +903,7 @@ const deserializeAws_json1_1DescribeEngagementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -959,7 +959,7 @@ const deserializeAws_json1_1DescribePageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1015,7 +1015,7 @@ const deserializeAws_json1_1GetContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1071,7 +1071,7 @@ const deserializeAws_json1_1GetContactChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1127,7 +1127,7 @@ const deserializeAws_json1_1GetContactPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1180,7 +1180,7 @@ const deserializeAws_json1_1ListContactChannelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1236,7 +1236,7 @@ const deserializeAws_json1_1ListContactsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1286,7 +1286,7 @@ const deserializeAws_json1_1ListEngagementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1336,7 +1336,7 @@ const deserializeAws_json1_1ListPageReceiptsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1389,7 +1389,7 @@ const deserializeAws_json1_1ListPagesByContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1442,7 +1442,7 @@ const deserializeAws_json1_1ListPagesByEngagementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1495,7 +1495,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1548,7 +1548,7 @@ const deserializeAws_json1_1PutContactPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1604,7 +1604,7 @@ const deserializeAws_json1_1SendActivationCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1663,7 +1663,7 @@ const deserializeAws_json1_1StartEngagementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1719,7 +1719,7 @@ const deserializeAws_json1_1StopEngagementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1772,7 +1772,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1828,7 +1828,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1881,7 +1881,7 @@ const deserializeAws_json1_1UpdateContactCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1940,7 +1940,7 @@ const deserializeAws_json1_1UpdateContactChannelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3010,6 +3010,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts index 6d4509a0efa1..f327217c1c82 100644 --- a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts @@ -930,7 +930,7 @@ const deserializeAws_restJson1CreateReplicationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -986,7 +986,7 @@ const deserializeAws_restJson1CreateResponsePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1045,7 +1045,7 @@ const deserializeAws_restJson1CreateTimelineEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1098,7 +1098,7 @@ const deserializeAws_restJson1DeleteIncidentRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1145,7 +1145,7 @@ const deserializeAws_restJson1DeleteReplicationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1195,7 +1195,7 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1245,7 +1245,7 @@ const deserializeAws_restJson1DeleteResponsePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1292,7 +1292,7 @@ const deserializeAws_restJson1DeleteTimelineEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1342,7 +1342,7 @@ const deserializeAws_restJson1GetIncidentRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1395,7 +1395,7 @@ const deserializeAws_restJson1GetReplicationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1451,7 +1451,7 @@ const deserializeAws_restJson1GetResourcePoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1522,7 +1522,7 @@ const deserializeAws_restJson1GetResponsePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1575,7 +1575,7 @@ const deserializeAws_restJson1GetTimelineEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1634,7 +1634,7 @@ const deserializeAws_restJson1ListIncidentRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1687,7 +1687,7 @@ const deserializeAws_restJson1ListRelatedItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1740,7 +1740,7 @@ const deserializeAws_restJson1ListReplicationSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1796,7 +1796,7 @@ const deserializeAws_restJson1ListResponsePlansCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1846,7 +1846,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1902,7 +1902,7 @@ const deserializeAws_restJson1ListTimelineEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1952,7 +1952,7 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2005,7 +2005,7 @@ const deserializeAws_restJson1StartIncidentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2058,7 +2058,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2114,7 +2114,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2167,7 +2167,7 @@ const deserializeAws_restJson1UpdateDeletionProtectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2217,7 +2217,7 @@ const deserializeAws_restJson1UpdateIncidentRecordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2270,7 +2270,7 @@ const deserializeAws_restJson1UpdateRelatedItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2323,7 +2323,7 @@ const deserializeAws_restJson1UpdateReplicationSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2376,7 +2376,7 @@ const deserializeAws_restJson1UpdateResponsePlanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1UpdateTimelineEventCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3409,6 +3409,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-ssm/src/protocols/Aws_json1_1.ts b/clients/client-ssm/src/protocols/Aws_json1_1.ts index d3cf0f41f457..1e67326e580b 100644 --- a/clients/client-ssm/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/src/protocols/Aws_json1_1.ts @@ -2758,7 +2758,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2811,7 +2811,7 @@ const deserializeAws_json1_1AssociateOpsItemRelatedItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2864,7 +2864,7 @@ const deserializeAws_json1_1CancelCommandCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2914,7 +2914,7 @@ const deserializeAws_json1_1CancelMaintenanceWindowExecutionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2958,7 +2958,7 @@ const deserializeAws_json1_1CreateActivationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3002,7 +3002,7 @@ const deserializeAws_json1_1CreateAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3079,7 +3079,7 @@ const deserializeAws_json1_1CreateAssociationBatchCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3153,7 +3153,7 @@ const deserializeAws_json1_1CreateDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3209,7 +3209,7 @@ const deserializeAws_json1_1CreateMaintenanceWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3256,7 +3256,7 @@ const deserializeAws_json1_1CreateOpsItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3306,7 +3306,7 @@ const deserializeAws_json1_1CreateOpsMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3359,7 +3359,7 @@ const deserializeAws_json1_1CreatePatchBaselineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3406,7 +3406,7 @@ const deserializeAws_json1_1CreateResourceDataSyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3456,7 +3456,7 @@ const deserializeAws_json1_1DeleteActivationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3506,7 +3506,7 @@ const deserializeAws_json1_1DeleteAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3559,7 +3559,7 @@ const deserializeAws_json1_1DeleteDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3609,7 +3609,7 @@ const deserializeAws_json1_1DeleteInventoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3662,7 +3662,7 @@ const deserializeAws_json1_1DeleteMaintenanceWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3703,7 +3703,7 @@ const deserializeAws_json1_1DeleteOpsMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3750,7 +3750,7 @@ const deserializeAws_json1_1DeleteParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3794,7 +3794,7 @@ const deserializeAws_json1_1DeleteParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3835,7 +3835,7 @@ const deserializeAws_json1_1DeletePatchBaselineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3879,7 +3879,7 @@ const deserializeAws_json1_1DeleteResourceDataSyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3926,7 +3926,7 @@ const deserializeAws_json1_1DeregisterManagedInstanceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3970,7 +3970,7 @@ const deserializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4014,7 +4014,7 @@ const deserializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4061,7 +4061,7 @@ const deserializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4105,7 +4105,7 @@ const deserializeAws_json1_1DescribeActivationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4152,7 +4152,7 @@ const deserializeAws_json1_1DescribeAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4205,7 +4205,7 @@ const deserializeAws_json1_1DescribeAssociationExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4252,7 +4252,7 @@ const deserializeAws_json1_1DescribeAssociationExecutionTargetsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4302,7 +4302,7 @@ const deserializeAws_json1_1DescribeAutomationExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4352,7 +4352,7 @@ const deserializeAws_json1_1DescribeAutomationStepExecutionsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4405,7 +4405,7 @@ const deserializeAws_json1_1DescribeAvailablePatchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4446,7 +4446,7 @@ const deserializeAws_json1_1DescribeDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4493,7 +4493,7 @@ const deserializeAws_json1_1DescribeDocumentPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4546,7 +4546,7 @@ const deserializeAws_json1_1DescribeEffectiveInstanceAssociationsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4593,7 +4593,7 @@ const deserializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4643,7 +4643,7 @@ const deserializeAws_json1_1DescribeInstanceAssociationsStatusCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4690,7 +4690,7 @@ const deserializeAws_json1_1DescribeInstanceInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4743,7 +4743,7 @@ const deserializeAws_json1_1DescribeInstancePatchesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4793,7 +4793,7 @@ const deserializeAws_json1_1DescribeInstancePatchStatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4837,7 +4837,7 @@ const deserializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4884,7 +4884,7 @@ const deserializeAws_json1_1DescribeInventoryDeletionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4931,7 +4931,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowExecutionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4972,7 +4972,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsCom ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5016,7 +5016,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5060,7 +5060,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5101,7 +5101,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowScheduleCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5145,7 +5145,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowsForTargetCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5186,7 +5186,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowTargetsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5230,7 +5230,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5274,7 +5274,7 @@ const deserializeAws_json1_1DescribeOpsItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5315,7 +5315,7 @@ const deserializeAws_json1_1DescribeParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5368,7 +5368,7 @@ const deserializeAws_json1_1DescribePatchBaselinesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5409,7 +5409,7 @@ const deserializeAws_json1_1DescribePatchGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5450,7 +5450,7 @@ const deserializeAws_json1_1DescribePatchGroupStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5494,7 +5494,7 @@ const deserializeAws_json1_1DescribePatchPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5535,7 +5535,7 @@ const deserializeAws_json1_1DescribeSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5582,7 +5582,7 @@ const deserializeAws_json1_1DisassociateOpsItemRelatedItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5632,7 +5632,7 @@ const deserializeAws_json1_1GetAutomationExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5676,7 +5676,7 @@ const deserializeAws_json1_1GetCalendarStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5726,7 +5726,7 @@ const deserializeAws_json1_1GetCommandInvocationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5779,7 +5779,7 @@ const deserializeAws_json1_1GetConnectionStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5820,7 +5820,7 @@ const deserializeAws_json1_1GetDefaultPatchBaselineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5861,7 +5861,7 @@ const deserializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5908,7 +5908,7 @@ const deserializeAws_json1_1GetDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5955,7 +5955,7 @@ const deserializeAws_json1_1GetInventoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6014,7 +6014,7 @@ const deserializeAws_json1_1GetInventorySchemaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6061,7 +6061,7 @@ const deserializeAws_json1_1GetMaintenanceWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6105,7 +6105,7 @@ const deserializeAws_json1_1GetMaintenanceWindowExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6149,7 +6149,7 @@ const deserializeAws_json1_1GetMaintenanceWindowExecutionTaskCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6193,7 +6193,7 @@ const deserializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationCommandEr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6237,7 +6237,7 @@ const deserializeAws_json1_1GetMaintenanceWindowTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6281,7 +6281,7 @@ const deserializeAws_json1_1GetOpsItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6325,7 +6325,7 @@ const deserializeAws_json1_1GetOpsMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6372,7 +6372,7 @@ const deserializeAws_json1_1GetOpsSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6428,7 +6428,7 @@ const deserializeAws_json1_1GetParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6478,7 +6478,7 @@ const deserializeAws_json1_1GetParameterHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6528,7 +6528,7 @@ const deserializeAws_json1_1GetParametersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6572,7 +6572,7 @@ const deserializeAws_json1_1GetParametersByPathCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6628,7 +6628,7 @@ const deserializeAws_json1_1GetPatchBaselineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6675,7 +6675,7 @@ const deserializeAws_json1_1GetPatchBaselineForPatchGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6716,7 +6716,7 @@ const deserializeAws_json1_1GetServiceSettingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6760,7 +6760,7 @@ const deserializeAws_json1_1LabelParameterVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6813,7 +6813,7 @@ const deserializeAws_json1_1ListAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6857,7 +6857,7 @@ const deserializeAws_json1_1ListAssociationVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6904,7 +6904,7 @@ const deserializeAws_json1_1ListCommandInvocationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6957,7 +6957,7 @@ const deserializeAws_json1_1ListCommandsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7010,7 +7010,7 @@ const deserializeAws_json1_1ListComplianceItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7063,7 +7063,7 @@ const deserializeAws_json1_1ListComplianceSummariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7110,7 +7110,7 @@ const deserializeAws_json1_1ListDocumentMetadataHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7160,7 +7160,7 @@ const deserializeAws_json1_1ListDocumentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7207,7 +7207,7 @@ const deserializeAws_json1_1ListDocumentVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7254,7 +7254,7 @@ const deserializeAws_json1_1ListInventoryEntriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7307,7 +7307,7 @@ const deserializeAws_json1_1ListOpsItemEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7357,7 +7357,7 @@ const deserializeAws_json1_1ListOpsItemRelatedItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7401,7 +7401,7 @@ const deserializeAws_json1_1ListOpsMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7445,7 +7445,7 @@ const deserializeAws_json1_1ListResourceComplianceSummariesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7492,7 +7492,7 @@ const deserializeAws_json1_1ListResourceDataSyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7539,7 +7539,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7586,7 +7586,7 @@ const deserializeAws_json1_1ModifyDocumentPermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7639,7 +7639,7 @@ const deserializeAws_json1_1PutComplianceItemsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7698,7 +7698,7 @@ const deserializeAws_json1_1PutInventoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7772,7 +7772,7 @@ const deserializeAws_json1_1PutParameterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7855,7 +7855,7 @@ const deserializeAws_json1_1RegisterDefaultPatchBaselineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7902,7 +7902,7 @@ const deserializeAws_json1_1RegisterPatchBaselineForPatchGroupCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7955,7 +7955,7 @@ const deserializeAws_json1_1RegisterTargetWithMaintenanceWindowCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8005,7 +8005,7 @@ const deserializeAws_json1_1RegisterTaskWithMaintenanceWindowCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8058,7 +8058,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8108,7 +8108,7 @@ const deserializeAws_json1_1ResetServiceSettingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8155,7 +8155,7 @@ const deserializeAws_json1_1ResumeSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8199,7 +8199,7 @@ const deserializeAws_json1_1SendAutomationSignalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8249,7 +8249,7 @@ const deserializeAws_json1_1SendCommandCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8320,7 +8320,7 @@ const deserializeAws_json1_1StartAssociationsOnceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8364,7 +8364,7 @@ const deserializeAws_json1_1StartAutomationExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8423,7 +8423,7 @@ const deserializeAws_json1_1StartChangeRequestExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8482,7 +8482,7 @@ const deserializeAws_json1_1StartSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8529,7 +8529,7 @@ const deserializeAws_json1_1StopAutomationExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8576,7 +8576,7 @@ const deserializeAws_json1_1TerminateSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8617,7 +8617,7 @@ const deserializeAws_json1_1UnlabelParameterVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8667,7 +8667,7 @@ const deserializeAws_json1_1UpdateAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8744,7 +8744,7 @@ const deserializeAws_json1_1UpdateAssociationStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8800,7 +8800,7 @@ const deserializeAws_json1_1UpdateDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8868,7 +8868,7 @@ const deserializeAws_json1_1UpdateDocumentDefaultVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8918,7 +8918,7 @@ const deserializeAws_json1_1UpdateDocumentMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8968,7 +8968,7 @@ const deserializeAws_json1_1UpdateMaintenanceWindowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9012,7 +9012,7 @@ const deserializeAws_json1_1UpdateMaintenanceWindowTargetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9056,7 +9056,7 @@ const deserializeAws_json1_1UpdateMaintenanceWindowTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9100,7 +9100,7 @@ const deserializeAws_json1_1UpdateManagedInstanceRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9144,7 +9144,7 @@ const deserializeAws_json1_1UpdateOpsItemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9197,7 +9197,7 @@ const deserializeAws_json1_1UpdateOpsMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9250,7 +9250,7 @@ const deserializeAws_json1_1UpdatePatchBaselineCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9294,7 +9294,7 @@ const deserializeAws_json1_1UpdateResourceDataSyncCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -9344,7 +9344,7 @@ const deserializeAws_json1_1UpdateServiceSettingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -20458,6 +20458,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts index abb6fa67c9bf..aa7c85e1c8eb 100644 --- a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts +++ b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts @@ -757,7 +757,7 @@ const deserializeAws_json1_1AttachCustomerManagedPolicyReferenceToPermissionSetC ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -816,7 +816,7 @@ const deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -875,7 +875,7 @@ const deserializeAws_json1_1CreateAccountAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -934,7 +934,7 @@ const deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCom ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -990,7 +990,7 @@ const deserializeAws_json1_1CreatePermissionSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1049,7 +1049,7 @@ const deserializeAws_json1_1DeleteAccountAssignmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1105,7 +1105,7 @@ const deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1161,7 +1161,7 @@ const deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCom ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1217,7 +1217,7 @@ const deserializeAws_json1_1DeletePermissionsBoundaryFromPermissionSetCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1270,7 +1270,7 @@ const deserializeAws_json1_1DeletePermissionSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1326,7 +1326,7 @@ const deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1379,7 +1379,7 @@ const deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1432,7 +1432,7 @@ const deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationC ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1485,7 +1485,7 @@ const deserializeAws_json1_1DescribePermissionSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1591,7 +1591,7 @@ const deserializeAws_json1_1DetachCustomerManagedPolicyReferenceFromPermissionSe ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1647,7 +1647,7 @@ const deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1703,7 +1703,7 @@ const deserializeAws_json1_1GetInlinePolicyForPermissionSetCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1756,7 +1756,7 @@ const deserializeAws_json1_1GetPermissionsBoundaryForPermissionSetCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1809,7 +1809,7 @@ const deserializeAws_json1_1ListAccountAssignmentCreationStatusCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1862,7 +1862,7 @@ const deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1915,7 +1915,7 @@ const deserializeAws_json1_1ListAccountAssignmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1968,7 +1968,7 @@ const deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2021,7 +2021,7 @@ const deserializeAws_json1_1ListCustomerManagedPolicyReferencesInPermissionSetCo ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2074,7 +2074,7 @@ const deserializeAws_json1_1ListInstancesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2124,7 +2124,7 @@ const deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2177,7 +2177,7 @@ const deserializeAws_json1_1ListPermissionSetProvisioningStatusCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2230,7 +2230,7 @@ const deserializeAws_json1_1ListPermissionSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2283,7 +2283,7 @@ const deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2336,7 +2336,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2389,7 +2389,7 @@ const deserializeAws_json1_1ProvisionPermissionSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2445,7 +2445,7 @@ const deserializeAws_json1_1PutInlinePolicyToPermissionSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2504,7 +2504,7 @@ const deserializeAws_json1_1PutPermissionsBoundaryToPermissionSetCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2560,7 +2560,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2619,7 +2619,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2675,7 +2675,7 @@ const deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCom ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2731,7 +2731,7 @@ const deserializeAws_json1_1UpdatePermissionSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4160,6 +4160,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts index 3174bacba08f..5adde469c4c3 100644 --- a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts @@ -156,7 +156,7 @@ const deserializeAws_restJson1CreateTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -242,7 +242,7 @@ const deserializeAws_restJson1RegisterClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -307,7 +307,7 @@ const deserializeAws_restJson1StartDeviceAuthorizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -608,6 +608,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sso/src/protocols/Aws_restJson1.ts b/clients/client-sso/src/protocols/Aws_restJson1.ts index a98ea59c075a..4123b876fb9e 100644 --- a/clients/client-sso/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso/src/protocols/Aws_restJson1.ts @@ -155,7 +155,7 @@ const deserializeAws_restJson1GetRoleCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -208,7 +208,7 @@ const deserializeAws_restJson1ListAccountRolesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -261,7 +261,7 @@ const deserializeAws_restJson1ListAccountsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -308,7 +308,7 @@ const deserializeAws_restJson1LogoutCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -479,6 +479,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts index 2d0d9fc7954a..d613e4d61093 100644 --- a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts @@ -1674,7 +1674,7 @@ const deserializeAws_json1_1ActivateGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1718,7 +1718,7 @@ const deserializeAws_json1_1AddCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1762,7 +1762,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1806,7 +1806,7 @@ const deserializeAws_json1_1AddUploadBufferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1850,7 +1850,7 @@ const deserializeAws_json1_1AddWorkingStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1894,7 +1894,7 @@ const deserializeAws_json1_1AssignTapePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1938,7 +1938,7 @@ const deserializeAws_json1_1AssociateFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1982,7 +1982,7 @@ const deserializeAws_json1_1AttachVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2026,7 +2026,7 @@ const deserializeAws_json1_1CancelArchivalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2070,7 +2070,7 @@ const deserializeAws_json1_1CancelRetrievalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2114,7 +2114,7 @@ const deserializeAws_json1_1CreateCachediSCSIVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2158,7 +2158,7 @@ const deserializeAws_json1_1CreateNFSFileShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2202,7 +2202,7 @@ const deserializeAws_json1_1CreateSMBFileShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2246,7 +2246,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2293,7 +2293,7 @@ const deserializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2340,7 +2340,7 @@ const deserializeAws_json1_1CreateStorediSCSIVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2384,7 +2384,7 @@ const deserializeAws_json1_1CreateTapePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2428,7 +2428,7 @@ const deserializeAws_json1_1CreateTapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2472,7 +2472,7 @@ const deserializeAws_json1_1CreateTapeWithBarcodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2516,7 +2516,7 @@ const deserializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2560,7 +2560,7 @@ const deserializeAws_json1_1DeleteBandwidthRateLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2604,7 +2604,7 @@ const deserializeAws_json1_1DeleteChapCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2648,7 +2648,7 @@ const deserializeAws_json1_1DeleteFileShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2692,7 +2692,7 @@ const deserializeAws_json1_1DeleteGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2736,7 +2736,7 @@ const deserializeAws_json1_1DeleteSnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2780,7 +2780,7 @@ const deserializeAws_json1_1DeleteTapeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2824,7 +2824,7 @@ const deserializeAws_json1_1DeleteTapeArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2868,7 +2868,7 @@ const deserializeAws_json1_1DeleteTapePoolCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2912,7 +2912,7 @@ const deserializeAws_json1_1DeleteVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2956,7 +2956,7 @@ const deserializeAws_json1_1DescribeAvailabilityMonitorTestCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3000,7 +3000,7 @@ const deserializeAws_json1_1DescribeBandwidthRateLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3044,7 +3044,7 @@ const deserializeAws_json1_1DescribeBandwidthRateLimitScheduleCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3088,7 +3088,7 @@ const deserializeAws_json1_1DescribeCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3132,7 +3132,7 @@ const deserializeAws_json1_1DescribeCachediSCSIVolumesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3176,7 +3176,7 @@ const deserializeAws_json1_1DescribeChapCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3220,7 +3220,7 @@ const deserializeAws_json1_1DescribeFileSystemAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3264,7 +3264,7 @@ const deserializeAws_json1_1DescribeGatewayInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3308,7 +3308,7 @@ const deserializeAws_json1_1DescribeMaintenanceStartTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3352,7 +3352,7 @@ const deserializeAws_json1_1DescribeNFSFileSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3396,7 +3396,7 @@ const deserializeAws_json1_1DescribeSMBFileSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3440,7 +3440,7 @@ const deserializeAws_json1_1DescribeSMBSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3484,7 +3484,7 @@ const deserializeAws_json1_1DescribeSnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3528,7 +3528,7 @@ const deserializeAws_json1_1DescribeStorediSCSIVolumesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3572,7 +3572,7 @@ const deserializeAws_json1_1DescribeTapeArchivesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3616,7 +3616,7 @@ const deserializeAws_json1_1DescribeTapeRecoveryPointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3660,7 +3660,7 @@ const deserializeAws_json1_1DescribeTapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3704,7 +3704,7 @@ const deserializeAws_json1_1DescribeUploadBufferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3748,7 +3748,7 @@ const deserializeAws_json1_1DescribeVTLDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3792,7 +3792,7 @@ const deserializeAws_json1_1DescribeWorkingStorageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3836,7 +3836,7 @@ const deserializeAws_json1_1DetachVolumeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3880,7 +3880,7 @@ const deserializeAws_json1_1DisableGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3924,7 +3924,7 @@ const deserializeAws_json1_1DisassociateFileSystemCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3968,7 +3968,7 @@ const deserializeAws_json1_1JoinDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4012,7 +4012,7 @@ const deserializeAws_json1_1ListAutomaticTapeCreationPoliciesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4056,7 +4056,7 @@ const deserializeAws_json1_1ListFileSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4100,7 +4100,7 @@ const deserializeAws_json1_1ListFileSystemAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4144,7 +4144,7 @@ const deserializeAws_json1_1ListGatewaysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4188,7 +4188,7 @@ const deserializeAws_json1_1ListLocalDisksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4232,7 +4232,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4276,7 +4276,7 @@ const deserializeAws_json1_1ListTapePoolsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4320,7 +4320,7 @@ const deserializeAws_json1_1ListTapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4364,7 +4364,7 @@ const deserializeAws_json1_1ListVolumeInitiatorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4408,7 +4408,7 @@ const deserializeAws_json1_1ListVolumeRecoveryPointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4452,7 +4452,7 @@ const deserializeAws_json1_1ListVolumesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4496,7 +4496,7 @@ const deserializeAws_json1_1NotifyWhenUploadedCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4540,7 +4540,7 @@ const deserializeAws_json1_1RefreshCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4584,7 +4584,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4628,7 +4628,7 @@ const deserializeAws_json1_1ResetCacheCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4672,7 +4672,7 @@ const deserializeAws_json1_1RetrieveTapeArchiveCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4716,7 +4716,7 @@ const deserializeAws_json1_1RetrieveTapeRecoveryPointCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4760,7 +4760,7 @@ const deserializeAws_json1_1SetLocalConsolePasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4804,7 +4804,7 @@ const deserializeAws_json1_1SetSMBGuestPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4848,7 +4848,7 @@ const deserializeAws_json1_1ShutdownGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4892,7 +4892,7 @@ const deserializeAws_json1_1StartAvailabilityMonitorTestCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4936,7 +4936,7 @@ const deserializeAws_json1_1StartGatewayCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4980,7 +4980,7 @@ const deserializeAws_json1_1UpdateAutomaticTapeCreationPolicyCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5024,7 +5024,7 @@ const deserializeAws_json1_1UpdateBandwidthRateLimitCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5068,7 +5068,7 @@ const deserializeAws_json1_1UpdateBandwidthRateLimitScheduleCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5112,7 +5112,7 @@ const deserializeAws_json1_1UpdateChapCredentialsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5156,7 +5156,7 @@ const deserializeAws_json1_1UpdateFileSystemAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5200,7 +5200,7 @@ const deserializeAws_json1_1UpdateGatewayInformationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5244,7 +5244,7 @@ const deserializeAws_json1_1UpdateGatewaySoftwareNowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5288,7 +5288,7 @@ const deserializeAws_json1_1UpdateMaintenanceStartTimeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5332,7 +5332,7 @@ const deserializeAws_json1_1UpdateNFSFileShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5376,7 +5376,7 @@ const deserializeAws_json1_1UpdateSMBFileShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5420,7 +5420,7 @@ const deserializeAws_json1_1UpdateSMBFileShareVisibilityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5464,7 +5464,7 @@ const deserializeAws_json1_1UpdateSMBLocalGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5508,7 +5508,7 @@ const deserializeAws_json1_1UpdateSMBSecurityStrategyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5552,7 +5552,7 @@ const deserializeAws_json1_1UpdateSnapshotScheduleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5596,7 +5596,7 @@ const deserializeAws_json1_1UpdateVTLDeviceTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8670,6 +8670,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-sts/src/protocols/Aws_query.ts b/clients/client-sts/src/protocols/Aws_query.ts index 3a34098729cd..54cd3b0b9949 100644 --- a/clients/client-sts/src/protocols/Aws_query.ts +++ b/clients/client-sts/src/protocols/Aws_query.ts @@ -217,7 +217,7 @@ const deserializeAws_queryAssumeRoleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -267,7 +267,7 @@ const deserializeAws_queryAssumeRoleWithSAMLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -323,7 +323,7 @@ const deserializeAws_queryAssumeRoleWithWebIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -382,7 +382,7 @@ const deserializeAws_queryDecodeAuthorizationMessageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -423,7 +423,7 @@ const deserializeAws_queryGetAccessKeyInfoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -458,7 +458,7 @@ const deserializeAws_queryGetCallerIdentityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -493,7 +493,7 @@ const deserializeAws_queryGetFederationTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -540,7 +540,7 @@ const deserializeAws_queryGetSessionTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1304,6 +1304,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/clients/client-support-app/src/protocols/Aws_restJson1.ts b/clients/client-support-app/src/protocols/Aws_restJson1.ts index a081afcf82e6..47ad22fcaa22 100644 --- a/clients/client-support-app/src/protocols/Aws_restJson1.ts +++ b/clients/client-support-app/src/protocols/Aws_restJson1.ts @@ -320,7 +320,7 @@ const deserializeAws_restJson1CreateSlackChannelConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -370,7 +370,7 @@ const deserializeAws_restJson1DeleteAccountAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -414,7 +414,7 @@ const deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -464,7 +464,7 @@ const deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -517,7 +517,7 @@ const deserializeAws_restJson1GetAccountAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -564,7 +564,7 @@ const deserializeAws_restJson1ListSlackChannelConfigurationsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -614,7 +614,7 @@ const deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -655,7 +655,7 @@ const deserializeAws_restJson1PutAccountAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -723,7 +723,7 @@ const deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -939,6 +939,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-support/src/protocols/Aws_json1_1.ts b/clients/client-support/src/protocols/Aws_json1_1.ts index 0f7d3345b408..c870ee06709d 100644 --- a/clients/client-support/src/protocols/Aws_json1_1.ts +++ b/clients/client-support/src/protocols/Aws_json1_1.ts @@ -318,7 +318,7 @@ const deserializeAws_json1_1AddAttachmentsToSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -371,7 +371,7 @@ const deserializeAws_json1_1AddCommunicationToCaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -421,7 +421,7 @@ const deserializeAws_json1_1CreateCaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -471,7 +471,7 @@ const deserializeAws_json1_1DescribeAttachmentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -518,7 +518,7 @@ const deserializeAws_json1_1DescribeCasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -562,7 +562,7 @@ const deserializeAws_json1_1DescribeCommunicationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -606,7 +606,7 @@ const deserializeAws_json1_1DescribeServicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -647,7 +647,7 @@ const deserializeAws_json1_1DescribeSeverityLevelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -688,7 +688,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -729,7 +729,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -770,7 +770,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -811,7 +811,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -852,7 +852,7 @@ const deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -893,7 +893,7 @@ const deserializeAws_json1_1ResolveCaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1834,6 +1834,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-swf/src/protocols/Aws_json1_0.ts b/clients/client-swf/src/protocols/Aws_json1_0.ts index 0399c1ea7415..278984e569a8 100644 --- a/clients/client-swf/src/protocols/Aws_json1_0.ts +++ b/clients/client-swf/src/protocols/Aws_json1_0.ts @@ -798,7 +798,7 @@ const deserializeAws_json1_0CountClosedWorkflowExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -842,7 +842,7 @@ const deserializeAws_json1_0CountOpenWorkflowExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -886,7 +886,7 @@ const deserializeAws_json1_0CountPendingActivityTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -930,7 +930,7 @@ const deserializeAws_json1_0CountPendingDecisionTasksCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -971,7 +971,7 @@ const deserializeAws_json1_0DeprecateActivityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1015,7 +1015,7 @@ const deserializeAws_json1_0DeprecateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1059,7 +1059,7 @@ const deserializeAws_json1_0DeprecateWorkflowTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1106,7 +1106,7 @@ const deserializeAws_json1_0DescribeActivityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1150,7 +1150,7 @@ const deserializeAws_json1_0DescribeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1194,7 +1194,7 @@ const deserializeAws_json1_0DescribeWorkflowExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1238,7 +1238,7 @@ const deserializeAws_json1_0DescribeWorkflowTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1282,7 +1282,7 @@ const deserializeAws_json1_0GetWorkflowExecutionHistoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1326,7 +1326,7 @@ const deserializeAws_json1_0ListActivityTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1370,7 +1370,7 @@ const deserializeAws_json1_0ListClosedWorkflowExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1414,7 +1414,7 @@ const deserializeAws_json1_0ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1455,7 +1455,7 @@ const deserializeAws_json1_0ListOpenWorkflowExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1499,7 +1499,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1546,7 +1546,7 @@ const deserializeAws_json1_0ListWorkflowTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1590,7 +1590,7 @@ const deserializeAws_json1_0PollForActivityTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1637,7 +1637,7 @@ const deserializeAws_json1_0PollForDecisionTaskCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1684,7 +1684,7 @@ const deserializeAws_json1_0RecordActivityTaskHeartbeatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1725,7 +1725,7 @@ const deserializeAws_json1_0RegisterActivityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1772,7 +1772,7 @@ const deserializeAws_json1_0RegisterDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1819,7 +1819,7 @@ const deserializeAws_json1_0RegisterWorkflowTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1866,7 +1866,7 @@ const deserializeAws_json1_0RequestCancelWorkflowExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1907,7 +1907,7 @@ const deserializeAws_json1_0RespondActivityTaskCanceledCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1948,7 +1948,7 @@ const deserializeAws_json1_0RespondActivityTaskCompletedCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1989,7 +1989,7 @@ const deserializeAws_json1_0RespondActivityTaskFailedCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_json1_0RespondDecisionTaskCompletedCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2071,7 +2071,7 @@ const deserializeAws_json1_0SignalWorkflowExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2115,7 +2115,7 @@ const deserializeAws_json1_0StartWorkflowExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2168,7 +2168,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2215,7 +2215,7 @@ const deserializeAws_json1_0TerminateWorkflowExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2256,7 +2256,7 @@ const deserializeAws_json1_0UndeprecateActivityTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2300,7 +2300,7 @@ const deserializeAws_json1_0UndeprecateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2344,7 +2344,7 @@ const deserializeAws_json1_0UndeprecateWorkflowTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2388,7 +2388,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4921,6 +4921,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-synthetics/src/protocols/Aws_restJson1.ts b/clients/client-synthetics/src/protocols/Aws_restJson1.ts index 4b8a26aeaf2b..755f19b06873 100644 --- a/clients/client-synthetics/src/protocols/Aws_restJson1.ts +++ b/clients/client-synthetics/src/protocols/Aws_restJson1.ts @@ -688,7 +688,7 @@ const deserializeAws_restJson1AssociateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -741,7 +741,7 @@ const deserializeAws_restJson1CreateCanaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -788,7 +788,7 @@ const deserializeAws_restJson1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -835,7 +835,7 @@ const deserializeAws_restJson1DeleteCanaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -882,7 +882,7 @@ const deserializeAws_restJson1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -935,7 +935,7 @@ const deserializeAws_restJson1DescribeCanariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -982,7 +982,7 @@ const deserializeAws_restJson1DescribeCanariesLastRunCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1029,7 +1029,7 @@ const deserializeAws_restJson1DescribeRuntimeVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1070,7 +1070,7 @@ const deserializeAws_restJson1DisassociateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1120,7 +1120,7 @@ const deserializeAws_restJson1GetCanaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1167,7 +1167,7 @@ const deserializeAws_restJson1GetCanaryRunsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1214,7 +1214,7 @@ const deserializeAws_restJson1GetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1267,7 +1267,7 @@ const deserializeAws_restJson1ListAssociatedGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1317,7 +1317,7 @@ const deserializeAws_restJson1ListGroupResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1370,7 +1370,7 @@ const deserializeAws_restJson1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1414,7 +1414,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1464,7 +1464,7 @@ const deserializeAws_restJson1StartCanaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1511,7 +1511,7 @@ const deserializeAws_restJson1StopCanaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1558,7 +1558,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1608,7 +1608,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1658,7 +1658,7 @@ const deserializeAws_restJson1UpdateCanaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2358,6 +2358,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-textract/src/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts index 78fed9462f1c..48a0e9eb05ad 100644 --- a/clients/client-textract/src/protocols/Aws_json1_1.ts +++ b/clients/client-textract/src/protocols/Aws_json1_1.ts @@ -261,7 +261,7 @@ const deserializeAws_json1_1AnalyzeDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -329,7 +329,7 @@ const deserializeAws_json1_1AnalyzeExpenseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -394,7 +394,7 @@ const deserializeAws_json1_1AnalyzeIDCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -459,7 +459,7 @@ const deserializeAws_json1_1DetectDocumentTextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -524,7 +524,7 @@ const deserializeAws_json1_1GetDocumentAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -586,7 +586,7 @@ const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -648,7 +648,7 @@ const deserializeAws_json1_1GetExpenseAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -710,7 +710,7 @@ const deserializeAws_json1_1StartDocumentAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -784,7 +784,7 @@ const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -858,7 +858,7 @@ const deserializeAws_json1_1StartExpenseAnalysisCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2015,6 +2015,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts index a3e1340e80eb..ca1fc4b14355 100644 --- a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts @@ -310,7 +310,7 @@ const deserializeAws_json1_0CancelQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -363,7 +363,7 @@ const deserializeAws_json1_0CreateScheduledQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -419,7 +419,7 @@ const deserializeAws_json1_0DeleteScheduledQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -475,7 +475,7 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -522,7 +522,7 @@ const deserializeAws_json1_0DescribeScheduledQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -575,7 +575,7 @@ const deserializeAws_json1_0ExecuteScheduledQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -631,7 +631,7 @@ const deserializeAws_json1_0ListScheduledQueriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -684,7 +684,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -734,7 +734,7 @@ const deserializeAws_json1_0PrepareQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -787,7 +787,7 @@ const deserializeAws_json1_0QueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -846,7 +846,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -899,7 +899,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -946,7 +946,7 @@ const deserializeAws_json1_0UpdateScheduledQueryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2116,6 +2116,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts index 3513ea04d59b..61634569083d 100644 --- a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts @@ -308,7 +308,7 @@ const deserializeAws_json1_0CreateDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -367,7 +367,7 @@ const deserializeAws_json1_0CreateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -426,7 +426,7 @@ const deserializeAws_json1_0DeleteDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -479,7 +479,7 @@ const deserializeAws_json1_0DeleteTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -535,7 +535,7 @@ const deserializeAws_json1_0DescribeDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -591,7 +591,7 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -638,7 +638,7 @@ const deserializeAws_json1_0DescribeTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -694,7 +694,7 @@ const deserializeAws_json1_0ListDatabasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -747,7 +747,7 @@ const deserializeAws_json1_0ListTablesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -803,7 +803,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -853,7 +853,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -906,7 +906,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -959,7 +959,7 @@ const deserializeAws_json1_0UpdateDatabaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1018,7 +1018,7 @@ const deserializeAws_json1_0UpdateTableCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1074,7 +1074,7 @@ const deserializeAws_json1_0WriteRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1867,6 +1867,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts index cd033dab8ea3..bc07128cfef0 100644 --- a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts @@ -207,7 +207,7 @@ const deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -298,7 +298,7 @@ const deserializeAws_restJson1StartStreamTranscriptionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -866,6 +866,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-transcribe/src/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts index 0f05b8f04d22..eecedf9b20dc 100644 --- a/clients/client-transcribe/src/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/src/protocols/Aws_json1_1.ts @@ -800,7 +800,7 @@ const deserializeAws_json1_1CreateCallAnalyticsCategoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -850,7 +850,7 @@ const deserializeAws_json1_1CreateLanguageModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -900,7 +900,7 @@ const deserializeAws_json1_1CreateMedicalVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -950,7 +950,7 @@ const deserializeAws_json1_1CreateVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1000,7 +1000,7 @@ const deserializeAws_json1_1CreateVocabularyFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1050,7 +1050,7 @@ const deserializeAws_json1_1DeleteCallAnalyticsCategoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1100,7 +1100,7 @@ const deserializeAws_json1_1DeleteCallAnalyticsJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1144,7 +1144,7 @@ const deserializeAws_json1_1DeleteLanguageModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1188,7 +1188,7 @@ const deserializeAws_json1_1DeleteMedicalTranscriptionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1232,7 +1232,7 @@ const deserializeAws_json1_1DeleteMedicalVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1279,7 +1279,7 @@ const deserializeAws_json1_1DeleteTranscriptionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1323,7 +1323,7 @@ const deserializeAws_json1_1DeleteVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1370,7 +1370,7 @@ const deserializeAws_json1_1DeleteVocabularyFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1420,7 +1420,7 @@ const deserializeAws_json1_1DescribeLanguageModelCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1470,7 +1470,7 @@ const deserializeAws_json1_1GetCallAnalyticsCategoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1520,7 +1520,7 @@ const deserializeAws_json1_1GetCallAnalyticsJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1570,7 +1570,7 @@ const deserializeAws_json1_1GetMedicalTranscriptionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1620,7 +1620,7 @@ const deserializeAws_json1_1GetMedicalVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1670,7 +1670,7 @@ const deserializeAws_json1_1GetTranscriptionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1720,7 +1720,7 @@ const deserializeAws_json1_1GetVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1770,7 +1770,7 @@ const deserializeAws_json1_1GetVocabularyFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1820,7 +1820,7 @@ const deserializeAws_json1_1ListCallAnalyticsCategoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1867,7 +1867,7 @@ const deserializeAws_json1_1ListCallAnalyticsJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1914,7 +1914,7 @@ const deserializeAws_json1_1ListLanguageModelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1961,7 +1961,7 @@ const deserializeAws_json1_1ListMedicalTranscriptionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2008,7 +2008,7 @@ const deserializeAws_json1_1ListMedicalVocabulariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2055,7 +2055,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2105,7 +2105,7 @@ const deserializeAws_json1_1ListTranscriptionJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2152,7 +2152,7 @@ const deserializeAws_json1_1ListVocabulariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2199,7 +2199,7 @@ const deserializeAws_json1_1ListVocabularyFiltersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2246,7 +2246,7 @@ const deserializeAws_json1_1StartCallAnalyticsJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2296,7 +2296,7 @@ const deserializeAws_json1_1StartMedicalTranscriptionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2346,7 +2346,7 @@ const deserializeAws_json1_1StartTranscriptionJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2396,7 +2396,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2449,7 +2449,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2502,7 +2502,7 @@ const deserializeAws_json1_1UpdateCallAnalyticsCategoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2555,7 +2555,7 @@ const deserializeAws_json1_1UpdateMedicalVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2608,7 +2608,7 @@ const deserializeAws_json1_1UpdateVocabularyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2661,7 +2661,7 @@ const deserializeAws_json1_1UpdateVocabularyFilterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4728,6 +4728,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-transfer/src/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts index df65541ae5ea..5e48cd2ad227 100644 --- a/clients/client-transfer/src/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/src/protocols/Aws_json1_1.ts @@ -1036,7 +1036,7 @@ const deserializeAws_json1_1CreateAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1089,7 +1089,7 @@ const deserializeAws_json1_1CreateAgreementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1142,7 +1142,7 @@ const deserializeAws_json1_1CreateConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1195,7 +1195,7 @@ const deserializeAws_json1_1CreateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1245,7 +1245,7 @@ const deserializeAws_json1_1CreateServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1304,7 +1304,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1357,7 +1357,7 @@ const deserializeAws_json1_1CreateWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1410,7 +1410,7 @@ const deserializeAws_json1_1DeleteAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1457,7 +1457,7 @@ const deserializeAws_json1_1DeleteAgreementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1504,7 +1504,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1551,7 +1551,7 @@ const deserializeAws_json1_1DeleteConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1598,7 +1598,7 @@ const deserializeAws_json1_1DeleteHostKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1648,7 +1648,7 @@ const deserializeAws_json1_1DeleteProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1695,7 +1695,7 @@ const deserializeAws_json1_1DeleteServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1745,7 +1745,7 @@ const deserializeAws_json1_1DeleteSshPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1795,7 +1795,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1842,7 +1842,7 @@ const deserializeAws_json1_1DeleteWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1895,7 +1895,7 @@ const deserializeAws_json1_1DescribeAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1945,7 +1945,7 @@ const deserializeAws_json1_1DescribeAgreementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1995,7 +1995,7 @@ const deserializeAws_json1_1DescribeCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2045,7 +2045,7 @@ const deserializeAws_json1_1DescribeConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2095,7 +2095,7 @@ const deserializeAws_json1_1DescribeExecutionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2145,7 +2145,7 @@ const deserializeAws_json1_1DescribeHostKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2195,7 +2195,7 @@ const deserializeAws_json1_1DescribeProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2245,7 +2245,7 @@ const deserializeAws_json1_1DescribeSecurityPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2295,7 +2295,7 @@ const deserializeAws_json1_1DescribeServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2345,7 +2345,7 @@ const deserializeAws_json1_1DescribeUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2395,7 +2395,7 @@ const deserializeAws_json1_1DescribeWorkflowCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2445,7 +2445,7 @@ const deserializeAws_json1_1ImportCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2495,7 +2495,7 @@ const deserializeAws_json1_1ImportHostKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2551,7 +2551,7 @@ const deserializeAws_json1_1ImportSshPublicKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2607,7 +2607,7 @@ const deserializeAws_json1_1ListAccessesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2660,7 +2660,7 @@ const deserializeAws_json1_1ListAgreementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2713,7 +2713,7 @@ const deserializeAws_json1_1ListCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2766,7 +2766,7 @@ const deserializeAws_json1_1ListConnectorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2819,7 +2819,7 @@ const deserializeAws_json1_1ListExecutionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2872,7 +2872,7 @@ const deserializeAws_json1_1ListHostKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2925,7 +2925,7 @@ const deserializeAws_json1_1ListProfilesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2978,7 +2978,7 @@ const deserializeAws_json1_1ListSecurityPoliciesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3028,7 +3028,7 @@ const deserializeAws_json1_1ListServersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3078,7 +3078,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3128,7 +3128,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3181,7 +3181,7 @@ const deserializeAws_json1_1ListWorkflowsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3231,7 +3231,7 @@ const deserializeAws_json1_1SendWorkflowStepStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3287,7 +3287,7 @@ const deserializeAws_json1_1StartFileTransferCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3337,7 +3337,7 @@ const deserializeAws_json1_1StartServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3387,7 +3387,7 @@ const deserializeAws_json1_1StopServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3437,7 +3437,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3487,7 +3487,7 @@ const deserializeAws_json1_1TestIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3534,7 +3534,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3584,7 +3584,7 @@ const deserializeAws_json1_1UpdateAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3637,7 +3637,7 @@ const deserializeAws_json1_1UpdateAgreementCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3690,7 +3690,7 @@ const deserializeAws_json1_1UpdateCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3740,7 +3740,7 @@ const deserializeAws_json1_1UpdateConnectorCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3793,7 +3793,7 @@ const deserializeAws_json1_1UpdateHostKeyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3846,7 +3846,7 @@ const deserializeAws_json1_1UpdateProfileCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3896,7 +3896,7 @@ const deserializeAws_json1_1UpdateServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3958,7 +3958,7 @@ const deserializeAws_json1_1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -6347,6 +6347,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-translate/src/protocols/Aws_json1_1.ts b/clients/client-translate/src/protocols/Aws_json1_1.ts index 3f19b649bdd4..d65a91ef2aad 100644 --- a/clients/client-translate/src/protocols/Aws_json1_1.ts +++ b/clients/client-translate/src/protocols/Aws_json1_1.ts @@ -326,7 +326,7 @@ const deserializeAws_json1_1CreateParallelDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -382,7 +382,7 @@ const deserializeAws_json1_1DeleteParallelDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -429,7 +429,7 @@ const deserializeAws_json1_1DeleteTerminologyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -479,7 +479,7 @@ const deserializeAws_json1_1DescribeTextTranslationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -526,7 +526,7 @@ const deserializeAws_json1_1GetParallelDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -576,7 +576,7 @@ const deserializeAws_json1_1GetTerminologyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -626,7 +626,7 @@ const deserializeAws_json1_1ImportTerminologyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -676,7 +676,7 @@ const deserializeAws_json1_1ListLanguagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -726,7 +726,7 @@ const deserializeAws_json1_1ListParallelDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -773,7 +773,7 @@ const deserializeAws_json1_1ListTerminologiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -820,7 +820,7 @@ const deserializeAws_json1_1ListTextTranslationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -870,7 +870,7 @@ const deserializeAws_json1_1StartTextTranslationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -926,7 +926,7 @@ const deserializeAws_json1_1StopTextTranslationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -973,7 +973,7 @@ const deserializeAws_json1_1TranslateTextCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1035,7 +1035,7 @@ const deserializeAws_json1_1UpdateParallelDataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2173,6 +2173,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-voice-id/src/protocols/Aws_json1_0.ts b/clients/client-voice-id/src/protocols/Aws_json1_0.ts index fc10ba62b9e7..bfbc1075b076 100644 --- a/clients/client-voice-id/src/protocols/Aws_json1_0.ts +++ b/clients/client-voice-id/src/protocols/Aws_json1_0.ts @@ -432,7 +432,7 @@ const deserializeAws_json1_0CreateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -488,7 +488,7 @@ const deserializeAws_json1_0DeleteDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -541,7 +541,7 @@ const deserializeAws_json1_0DeleteFraudsterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -594,7 +594,7 @@ const deserializeAws_json1_0DeleteSpeakerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -650,7 +650,7 @@ const deserializeAws_json1_0DescribeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -703,7 +703,7 @@ const deserializeAws_json1_0DescribeFraudsterCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -756,7 +756,7 @@ const deserializeAws_json1_0DescribeFraudsterRegistrationJobCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -809,7 +809,7 @@ const deserializeAws_json1_0DescribeSpeakerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -862,7 +862,7 @@ const deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -915,7 +915,7 @@ const deserializeAws_json1_0EvaluateSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -971,7 +971,7 @@ const deserializeAws_json1_0ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1021,7 +1021,7 @@ const deserializeAws_json1_0ListFraudsterRegistrationJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1074,7 +1074,7 @@ const deserializeAws_json1_0ListSpeakerEnrollmentJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1127,7 +1127,7 @@ const deserializeAws_json1_0ListSpeakersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1180,7 +1180,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1233,7 +1233,7 @@ const deserializeAws_json1_0OptOutSpeakerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1292,7 +1292,7 @@ const deserializeAws_json1_0StartFraudsterRegistrationJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1351,7 +1351,7 @@ const deserializeAws_json1_0StartSpeakerEnrollmentJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1410,7 +1410,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1466,7 +1466,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1522,7 +1522,7 @@ const deserializeAws_json1_0UpdateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2636,6 +2636,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts index ed96462afac0..9974b09777d6 100644 --- a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts @@ -1521,7 +1521,7 @@ const deserializeAws_json1_1AssociateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1574,7 +1574,7 @@ const deserializeAws_json1_1CreateByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1630,7 +1630,7 @@ const deserializeAws_json1_1CreateGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1686,7 +1686,7 @@ const deserializeAws_json1_1CreateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1742,7 +1742,7 @@ const deserializeAws_json1_1CreateRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1804,7 +1804,7 @@ const deserializeAws_json1_1CreateRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1854,7 +1854,7 @@ const deserializeAws_json1_1CreateRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1904,7 +1904,7 @@ const deserializeAws_json1_1CreateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1966,7 +1966,7 @@ const deserializeAws_json1_1CreateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2025,7 +2025,7 @@ const deserializeAws_json1_1CreateSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2081,7 +2081,7 @@ const deserializeAws_json1_1CreateSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2137,7 +2137,7 @@ const deserializeAws_json1_1CreateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2202,7 +2202,7 @@ const deserializeAws_json1_1CreateWebACLMigrationStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2255,7 +2255,7 @@ const deserializeAws_json1_1CreateXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2311,7 +2311,7 @@ const deserializeAws_json1_1DeleteByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2367,7 +2367,7 @@ const deserializeAws_json1_1DeleteGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2423,7 +2423,7 @@ const deserializeAws_json1_1DeleteIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2479,7 +2479,7 @@ const deserializeAws_json1_1DeleteLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2526,7 +2526,7 @@ const deserializeAws_json1_1DeletePermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2573,7 +2573,7 @@ const deserializeAws_json1_1DeleteRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2635,7 +2635,7 @@ const deserializeAws_json1_1DeleteRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2691,7 +2691,7 @@ const deserializeAws_json1_1DeleteRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2747,7 +2747,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2809,7 +2809,7 @@ const deserializeAws_json1_1DeleteRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2871,7 +2871,7 @@ const deserializeAws_json1_1DeleteSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2927,7 +2927,7 @@ const deserializeAws_json1_1DeleteSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2983,7 +2983,7 @@ const deserializeAws_json1_1DeleteWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3045,7 +3045,7 @@ const deserializeAws_json1_1DeleteXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3101,7 +3101,7 @@ const deserializeAws_json1_1DisassociateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3151,7 +3151,7 @@ const deserializeAws_json1_1GetByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3198,7 +3198,7 @@ const deserializeAws_json1_1GetChangeTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3239,7 +3239,7 @@ const deserializeAws_json1_1GetChangeTokenStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3283,7 +3283,7 @@ const deserializeAws_json1_1GetGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3330,7 +3330,7 @@ const deserializeAws_json1_1GetIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3377,7 +3377,7 @@ const deserializeAws_json1_1GetLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3421,7 +3421,7 @@ const deserializeAws_json1_1GetPermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3465,7 +3465,7 @@ const deserializeAws_json1_1GetRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3512,7 +3512,7 @@ const deserializeAws_json1_1GetRateBasedRuleManagedKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3562,7 +3562,7 @@ const deserializeAws_json1_1GetRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3609,7 +3609,7 @@ const deserializeAws_json1_1GetRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3656,7 +3656,7 @@ const deserializeAws_json1_1GetRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3703,7 +3703,7 @@ const deserializeAws_json1_1GetRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3747,7 +3747,7 @@ const deserializeAws_json1_1GetSampledRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3791,7 +3791,7 @@ const deserializeAws_json1_1GetSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3838,7 +3838,7 @@ const deserializeAws_json1_1GetSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3885,7 +3885,7 @@ const deserializeAws_json1_1GetWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3932,7 +3932,7 @@ const deserializeAws_json1_1GetWebACLForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3985,7 +3985,7 @@ const deserializeAws_json1_1GetXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4032,7 +4032,7 @@ const deserializeAws_json1_1ListActivatedRulesInRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4079,7 +4079,7 @@ const deserializeAws_json1_1ListByteMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4123,7 +4123,7 @@ const deserializeAws_json1_1ListGeoMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4167,7 +4167,7 @@ const deserializeAws_json1_1ListIPSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4211,7 +4211,7 @@ const deserializeAws_json1_1ListLoggingConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4258,7 +4258,7 @@ const deserializeAws_json1_1ListRateBasedRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4302,7 +4302,7 @@ const deserializeAws_json1_1ListRegexMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4346,7 +4346,7 @@ const deserializeAws_json1_1ListRegexPatternSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4390,7 +4390,7 @@ const deserializeAws_json1_1ListResourcesForWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4440,7 +4440,7 @@ const deserializeAws_json1_1ListRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4481,7 +4481,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4525,7 +4525,7 @@ const deserializeAws_json1_1ListSizeConstraintSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4569,7 +4569,7 @@ const deserializeAws_json1_1ListSqlInjectionMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4613,7 +4613,7 @@ const deserializeAws_json1_1ListSubscribedRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4657,7 +4657,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4713,7 +4713,7 @@ const deserializeAws_json1_1ListWebACLsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4757,7 +4757,7 @@ const deserializeAws_json1_1ListXssMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4801,7 +4801,7 @@ const deserializeAws_json1_1PutLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4851,7 +4851,7 @@ const deserializeAws_json1_1PutPermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4901,7 +4901,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4960,7 +4960,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5016,7 +5016,7 @@ const deserializeAws_json1_1UpdateByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5078,7 +5078,7 @@ const deserializeAws_json1_1UpdateGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5143,7 +5143,7 @@ const deserializeAws_json1_1UpdateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5208,7 +5208,7 @@ const deserializeAws_json1_1UpdateRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5273,7 +5273,7 @@ const deserializeAws_json1_1UpdateRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5335,7 +5335,7 @@ const deserializeAws_json1_1UpdateRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5397,7 +5397,7 @@ const deserializeAws_json1_1UpdateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5462,7 +5462,7 @@ const deserializeAws_json1_1UpdateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5521,7 +5521,7 @@ const deserializeAws_json1_1UpdateSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5586,7 +5586,7 @@ const deserializeAws_json1_1UpdateSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5648,7 +5648,7 @@ const deserializeAws_json1_1UpdateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5716,7 +5716,7 @@ const deserializeAws_json1_1UpdateXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8858,6 +8858,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-waf/src/protocols/Aws_json1_1.ts b/clients/client-waf/src/protocols/Aws_json1_1.ts index 1bb714c3cc05..fff5365fad8b 100644 --- a/clients/client-waf/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf/src/protocols/Aws_json1_1.ts @@ -1450,7 +1450,7 @@ const deserializeAws_json1_1CreateByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1506,7 +1506,7 @@ const deserializeAws_json1_1CreateGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1562,7 +1562,7 @@ const deserializeAws_json1_1CreateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1618,7 +1618,7 @@ const deserializeAws_json1_1CreateRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1680,7 +1680,7 @@ const deserializeAws_json1_1CreateRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1730,7 +1730,7 @@ const deserializeAws_json1_1CreateRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1780,7 +1780,7 @@ const deserializeAws_json1_1CreateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1842,7 +1842,7 @@ const deserializeAws_json1_1CreateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1901,7 +1901,7 @@ const deserializeAws_json1_1CreateSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1957,7 +1957,7 @@ const deserializeAws_json1_1CreateSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2013,7 +2013,7 @@ const deserializeAws_json1_1CreateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2078,7 +2078,7 @@ const deserializeAws_json1_1CreateWebACLMigrationStackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2131,7 +2131,7 @@ const deserializeAws_json1_1CreateXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2187,7 +2187,7 @@ const deserializeAws_json1_1DeleteByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2243,7 +2243,7 @@ const deserializeAws_json1_1DeleteGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2299,7 +2299,7 @@ const deserializeAws_json1_1DeleteIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2355,7 +2355,7 @@ const deserializeAws_json1_1DeleteLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2402,7 +2402,7 @@ const deserializeAws_json1_1DeletePermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2449,7 +2449,7 @@ const deserializeAws_json1_1DeleteRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2511,7 +2511,7 @@ const deserializeAws_json1_1DeleteRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2567,7 +2567,7 @@ const deserializeAws_json1_1DeleteRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2623,7 +2623,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2685,7 +2685,7 @@ const deserializeAws_json1_1DeleteRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2747,7 +2747,7 @@ const deserializeAws_json1_1DeleteSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2803,7 +2803,7 @@ const deserializeAws_json1_1DeleteSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2859,7 +2859,7 @@ const deserializeAws_json1_1DeleteWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2921,7 +2921,7 @@ const deserializeAws_json1_1DeleteXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2977,7 +2977,7 @@ const deserializeAws_json1_1GetByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3024,7 +3024,7 @@ const deserializeAws_json1_1GetChangeTokenCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3065,7 +3065,7 @@ const deserializeAws_json1_1GetChangeTokenStatusCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3109,7 +3109,7 @@ const deserializeAws_json1_1GetGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3156,7 +3156,7 @@ const deserializeAws_json1_1GetIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3203,7 +3203,7 @@ const deserializeAws_json1_1GetLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3247,7 +3247,7 @@ const deserializeAws_json1_1GetPermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3291,7 +3291,7 @@ const deserializeAws_json1_1GetRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3338,7 +3338,7 @@ const deserializeAws_json1_1GetRateBasedRuleManagedKeysCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3388,7 +3388,7 @@ const deserializeAws_json1_1GetRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3435,7 +3435,7 @@ const deserializeAws_json1_1GetRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3482,7 +3482,7 @@ const deserializeAws_json1_1GetRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3529,7 +3529,7 @@ const deserializeAws_json1_1GetRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3573,7 +3573,7 @@ const deserializeAws_json1_1GetSampledRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3617,7 +3617,7 @@ const deserializeAws_json1_1GetSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3664,7 +3664,7 @@ const deserializeAws_json1_1GetSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3711,7 +3711,7 @@ const deserializeAws_json1_1GetWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3758,7 +3758,7 @@ const deserializeAws_json1_1GetXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3805,7 +3805,7 @@ const deserializeAws_json1_1ListActivatedRulesInRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3852,7 +3852,7 @@ const deserializeAws_json1_1ListByteMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3896,7 +3896,7 @@ const deserializeAws_json1_1ListGeoMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3940,7 +3940,7 @@ const deserializeAws_json1_1ListIPSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3984,7 +3984,7 @@ const deserializeAws_json1_1ListLoggingConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4031,7 +4031,7 @@ const deserializeAws_json1_1ListRateBasedRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4075,7 +4075,7 @@ const deserializeAws_json1_1ListRegexMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4119,7 +4119,7 @@ const deserializeAws_json1_1ListRegexPatternSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4163,7 +4163,7 @@ const deserializeAws_json1_1ListRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4204,7 +4204,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4248,7 +4248,7 @@ const deserializeAws_json1_1ListSizeConstraintSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4292,7 +4292,7 @@ const deserializeAws_json1_1ListSqlInjectionMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4336,7 +4336,7 @@ const deserializeAws_json1_1ListSubscribedRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4380,7 +4380,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4436,7 +4436,7 @@ const deserializeAws_json1_1ListWebACLsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4480,7 +4480,7 @@ const deserializeAws_json1_1ListXssMatchSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4524,7 +4524,7 @@ const deserializeAws_json1_1PutLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4574,7 +4574,7 @@ const deserializeAws_json1_1PutPermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4624,7 +4624,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4683,7 +4683,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4739,7 +4739,7 @@ const deserializeAws_json1_1UpdateByteMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4801,7 +4801,7 @@ const deserializeAws_json1_1UpdateGeoMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4866,7 +4866,7 @@ const deserializeAws_json1_1UpdateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4931,7 +4931,7 @@ const deserializeAws_json1_1UpdateRateBasedRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4996,7 +4996,7 @@ const deserializeAws_json1_1UpdateRegexMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5058,7 +5058,7 @@ const deserializeAws_json1_1UpdateRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5120,7 +5120,7 @@ const deserializeAws_json1_1UpdateRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5185,7 +5185,7 @@ const deserializeAws_json1_1UpdateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5244,7 +5244,7 @@ const deserializeAws_json1_1UpdateSizeConstraintSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5309,7 +5309,7 @@ const deserializeAws_json1_1UpdateSqlInjectionMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5371,7 +5371,7 @@ const deserializeAws_json1_1UpdateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5439,7 +5439,7 @@ const deserializeAws_json1_1UpdateXssMatchSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -8478,6 +8478,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-wafv2/src/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts index d7b254f5eead..d4961090ff68 100644 --- a/clients/client-wafv2/src/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/src/protocols/Aws_json1_1.ts @@ -997,7 +997,7 @@ const deserializeAws_json1_1AssociateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1050,7 +1050,7 @@ const deserializeAws_json1_1CheckCapacityCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1115,7 +1115,7 @@ const deserializeAws_json1_1CreateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1177,7 +1177,7 @@ const deserializeAws_json1_1CreateRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1239,7 +1239,7 @@ const deserializeAws_json1_1CreateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1310,7 +1310,7 @@ const deserializeAws_json1_1CreateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1387,7 +1387,7 @@ const deserializeAws_json1_1DeleteFirewallManagerRuleGroupsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1440,7 +1440,7 @@ const deserializeAws_json1_1DeleteIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1502,7 +1502,7 @@ const deserializeAws_json1_1DeleteLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1555,7 +1555,7 @@ const deserializeAws_json1_1DeletePermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1602,7 +1602,7 @@ const deserializeAws_json1_1DeleteRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1664,7 +1664,7 @@ const deserializeAws_json1_1DeleteRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1726,7 +1726,7 @@ const deserializeAws_json1_1DeleteWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1788,7 +1788,7 @@ const deserializeAws_json1_1DescribeManagedRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1844,7 +1844,7 @@ const deserializeAws_json1_1DisassociateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1894,7 +1894,7 @@ const deserializeAws_json1_1GenerateMobileSdkReleaseUrlCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1944,7 +1944,7 @@ const deserializeAws_json1_1GetIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1994,7 +1994,7 @@ const deserializeAws_json1_1GetLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2044,7 +2044,7 @@ const deserializeAws_json1_1GetManagedRuleSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2094,7 +2094,7 @@ const deserializeAws_json1_1GetMobileSdkReleaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2144,7 +2144,7 @@ const deserializeAws_json1_1GetPermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2191,7 +2191,7 @@ const deserializeAws_json1_1GetRateBasedStatementManagedKeysCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2241,7 +2241,7 @@ const deserializeAws_json1_1GetRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2291,7 +2291,7 @@ const deserializeAws_json1_1GetRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2341,7 +2341,7 @@ const deserializeAws_json1_1GetSampledRequestsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2388,7 +2388,7 @@ const deserializeAws_json1_1GetWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2438,7 +2438,7 @@ const deserializeAws_json1_1GetWebACLForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2491,7 +2491,7 @@ const deserializeAws_json1_1ListAvailableManagedRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2538,7 +2538,7 @@ const deserializeAws_json1_1ListAvailableManagedRuleGroupVersionsCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2588,7 +2588,7 @@ const deserializeAws_json1_1ListIPSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2635,7 +2635,7 @@ const deserializeAws_json1_1ListLoggingConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2682,7 +2682,7 @@ const deserializeAws_json1_1ListManagedRuleSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2729,7 +2729,7 @@ const deserializeAws_json1_1ListMobileSdkReleasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2776,7 +2776,7 @@ const deserializeAws_json1_1ListRegexPatternSetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2823,7 +2823,7 @@ const deserializeAws_json1_1ListResourcesForWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2873,7 +2873,7 @@ const deserializeAws_json1_1ListRuleGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2920,7 +2920,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2976,7 +2976,7 @@ const deserializeAws_json1_1ListWebACLsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3023,7 +3023,7 @@ const deserializeAws_json1_1PutLoggingConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3085,7 +3085,7 @@ const deserializeAws_json1_1PutManagedRuleSetVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3138,7 +3138,7 @@ const deserializeAws_json1_1PutPermissionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3188,7 +3188,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3247,7 +3247,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3303,7 +3303,7 @@ const deserializeAws_json1_1UpdateIPSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3362,7 +3362,7 @@ const deserializeAws_json1_1UpdateManagedRuleSetVersionExpiryDateCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3415,7 +3415,7 @@ const deserializeAws_json1_1UpdateRegexPatternSetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3474,7 +3474,7 @@ const deserializeAws_json1_1UpdateRuleGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3542,7 +3542,7 @@ const deserializeAws_json1_1UpdateWebACLCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7187,6 +7187,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts index 113472892e38..e5703b0a2082 100644 --- a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts +++ b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts @@ -1271,7 +1271,7 @@ const deserializeAws_restJson1AssociateLensesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1327,7 +1327,7 @@ const deserializeAws_restJson1CreateLensShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1389,7 +1389,7 @@ const deserializeAws_restJson1CreateLensVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1451,7 +1451,7 @@ const deserializeAws_restJson1CreateMilestoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1513,7 +1513,7 @@ const deserializeAws_restJson1CreateWorkloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1572,7 +1572,7 @@ const deserializeAws_restJson1CreateWorkloadShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1628,7 +1628,7 @@ const deserializeAws_restJson1DeleteLensCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1681,7 +1681,7 @@ const deserializeAws_restJson1DeleteLensShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1734,7 +1734,7 @@ const deserializeAws_restJson1DeleteWorkloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1787,7 +1787,7 @@ const deserializeAws_restJson1DeleteWorkloadShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1840,7 +1840,7 @@ const deserializeAws_restJson1DisassociateLensesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1896,7 +1896,7 @@ const deserializeAws_restJson1ExportLensCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1961,7 +1961,7 @@ const deserializeAws_restJson1GetAnswerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2014,7 +2014,7 @@ const deserializeAws_restJson1GetLensCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2073,7 +2073,7 @@ const deserializeAws_restJson1GetLensReviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2132,7 +2132,7 @@ const deserializeAws_restJson1GetLensReviewReportCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2200,7 +2200,7 @@ const deserializeAws_restJson1GetLensVersionDifferenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2256,7 +2256,7 @@ const deserializeAws_restJson1GetMilestoneCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2309,7 +2309,7 @@ const deserializeAws_restJson1GetWorkloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2365,7 +2365,7 @@ const deserializeAws_restJson1ImportLensCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2439,7 +2439,7 @@ const deserializeAws_restJson1ListAnswersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2495,7 +2495,7 @@ const deserializeAws_restJson1ListLensesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2560,7 +2560,7 @@ const deserializeAws_restJson1ListLensReviewImprovementsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2622,7 +2622,7 @@ const deserializeAws_restJson1ListLensReviewsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2678,7 +2678,7 @@ const deserializeAws_restJson1ListLensSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2737,7 +2737,7 @@ const deserializeAws_restJson1ListMilestonesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2793,7 +2793,7 @@ const deserializeAws_restJson1ListNotificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2849,7 +2849,7 @@ const deserializeAws_restJson1ListShareInvitationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2899,7 +2899,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2946,7 +2946,7 @@ const deserializeAws_restJson1ListWorkloadsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3005,7 +3005,7 @@ const deserializeAws_restJson1ListWorkloadSharesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3055,7 +3055,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3096,7 +3096,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3149,7 +3149,7 @@ const deserializeAws_restJson1UpdateAnswerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3202,7 +3202,7 @@ const deserializeAws_restJson1UpdateGlobalSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3258,7 +3258,7 @@ const deserializeAws_restJson1UpdateLensReviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3314,7 +3314,7 @@ const deserializeAws_restJson1UpdateShareInvitationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3370,7 +3370,7 @@ const deserializeAws_restJson1UpdateWorkloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3429,7 +3429,7 @@ const deserializeAws_restJson1UpdateWorkloadShareCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3482,7 +3482,7 @@ const deserializeAws_restJson1UpgradeLensReviewCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4538,6 +4538,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-wisdom/src/protocols/Aws_restJson1.ts b/clients/client-wisdom/src/protocols/Aws_restJson1.ts index 0a91a357456d..f0d1ee5958aa 100644 --- a/clients/client-wisdom/src/protocols/Aws_restJson1.ts +++ b/clients/client-wisdom/src/protocols/Aws_restJson1.ts @@ -1093,7 +1093,7 @@ const deserializeAws_restJson1CreateAssistantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1146,7 +1146,7 @@ const deserializeAws_restJson1CreateAssistantAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1199,7 +1199,7 @@ const deserializeAws_restJson1CreateContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1252,7 +1252,7 @@ const deserializeAws_restJson1CreateKnowledgeBaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1302,7 +1302,7 @@ const deserializeAws_restJson1CreateSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1346,7 +1346,7 @@ const deserializeAws_restJson1DeleteAssistantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1390,7 +1390,7 @@ const deserializeAws_restJson1DeleteAssistantAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1434,7 +1434,7 @@ const deserializeAws_restJson1DeleteContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1478,7 +1478,7 @@ const deserializeAws_restJson1DeleteKnowledgeBaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1528,7 +1528,7 @@ const deserializeAws_restJson1GetAssistantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1578,7 +1578,7 @@ const deserializeAws_restJson1GetAssistantAssociationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1625,7 +1625,7 @@ const deserializeAws_restJson1GetContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1672,7 +1672,7 @@ const deserializeAws_restJson1GetContentSummaryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1719,7 +1719,7 @@ const deserializeAws_restJson1GetKnowledgeBaseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1769,7 +1769,7 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1816,7 +1816,7 @@ const deserializeAws_restJson1GetSessionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1869,7 +1869,7 @@ const deserializeAws_restJson1ListAssistantAssociationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1919,7 +1919,7 @@ const deserializeAws_restJson1ListAssistantsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1966,7 +1966,7 @@ const deserializeAws_restJson1ListContentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2016,7 +2016,7 @@ const deserializeAws_restJson1ListKnowledgeBasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2060,7 +2060,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2104,7 +2104,7 @@ const deserializeAws_restJson1NotifyRecommendationsReceivedCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2163,7 +2163,7 @@ const deserializeAws_restJson1PutFeedbackCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2213,7 +2213,7 @@ const deserializeAws_restJson1QueryAssistantCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2257,7 +2257,7 @@ const deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2307,7 +2307,7 @@ const deserializeAws_restJson1SearchContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2357,7 +2357,7 @@ const deserializeAws_restJson1SearchSessionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2413,7 +2413,7 @@ const deserializeAws_restJson1StartContentUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2457,7 +2457,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2498,7 +2498,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2539,7 +2539,7 @@ const deserializeAws_restJson1UpdateContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2589,7 +2589,7 @@ const deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3412,6 +3412,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-workdocs/src/protocols/Aws_restJson1.ts b/clients/client-workdocs/src/protocols/Aws_restJson1.ts index aa21be1de49f..780cb1b104eb 100644 --- a/clients/client-workdocs/src/protocols/Aws_restJson1.ts +++ b/clients/client-workdocs/src/protocols/Aws_restJson1.ts @@ -1379,7 +1379,7 @@ const deserializeAws_restJson1AbortDocumentVersionUploadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1435,7 +1435,7 @@ const deserializeAws_restJson1ActivateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1488,7 +1488,7 @@ const deserializeAws_restJson1AddResourcePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1538,7 +1538,7 @@ const deserializeAws_restJson1CreateCommentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1597,7 +1597,7 @@ const deserializeAws_restJson1CreateCustomMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1656,7 +1656,7 @@ const deserializeAws_restJson1CreateFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1718,7 +1718,7 @@ const deserializeAws_restJson1CreateLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1774,7 +1774,7 @@ const deserializeAws_restJson1CreateNotificationSubscriptionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1821,7 +1821,7 @@ const deserializeAws_restJson1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1871,7 +1871,7 @@ const deserializeAws_restJson1DeactivateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1921,7 +1921,7 @@ const deserializeAws_restJson1DeleteCommentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1977,7 +1977,7 @@ const deserializeAws_restJson1DeleteCustomMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2030,7 +2030,7 @@ const deserializeAws_restJson1DeleteDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2089,7 +2089,7 @@ const deserializeAws_restJson1DeleteFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2148,7 +2148,7 @@ const deserializeAws_restJson1DeleteFolderContentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2204,7 +2204,7 @@ const deserializeAws_restJson1DeleteLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2254,7 +2254,7 @@ const deserializeAws_restJson1DeleteNotificationSubscriptionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2301,7 +2301,7 @@ const deserializeAws_restJson1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2357,7 +2357,7 @@ const deserializeAws_restJson1DescribeActivitiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2413,7 +2413,7 @@ const deserializeAws_restJson1DescribeCommentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2472,7 +2472,7 @@ const deserializeAws_restJson1DescribeDocumentVersionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2537,7 +2537,7 @@ const deserializeAws_restJson1DescribeFolderContentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2596,7 +2596,7 @@ const deserializeAws_restJson1DescribeGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2649,7 +2649,7 @@ const deserializeAws_restJson1DescribeNotificationSubscriptionsCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2699,7 +2699,7 @@ const deserializeAws_restJson1DescribeResourcePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2752,7 +2752,7 @@ const deserializeAws_restJson1DescribeRootFoldersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2811,7 +2811,7 @@ const deserializeAws_restJson1DescribeUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2870,7 +2870,7 @@ const deserializeAws_restJson1GetCurrentUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2926,7 +2926,7 @@ const deserializeAws_restJson1GetDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2985,7 +2985,7 @@ const deserializeAws_restJson1GetDocumentPathCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3041,7 +3041,7 @@ const deserializeAws_restJson1GetDocumentVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3103,7 +3103,7 @@ const deserializeAws_restJson1GetFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3162,7 +3162,7 @@ const deserializeAws_restJson1GetFolderPathCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3221,7 +3221,7 @@ const deserializeAws_restJson1GetResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3277,7 +3277,7 @@ const deserializeAws_restJson1InitiateDocumentVersionUploadCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3345,7 +3345,7 @@ const deserializeAws_restJson1RemoveAllResourcePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3392,7 +3392,7 @@ const deserializeAws_restJson1RemoveResourcePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3439,7 +3439,7 @@ const deserializeAws_restJson1UpdateDocumentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3504,7 +3504,7 @@ const deserializeAws_restJson1UpdateDocumentVersionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3563,7 +3563,7 @@ const deserializeAws_restJson1UpdateFolderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3631,7 +3631,7 @@ const deserializeAws_restJson1UpdateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4675,6 +4675,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-worklink/src/protocols/Aws_restJson1.ts b/clients/client-worklink/src/protocols/Aws_restJson1.ts index e6b72eef7f57..c496d8fcf9ce 100644 --- a/clients/client-worklink/src/protocols/Aws_restJson1.ts +++ b/clients/client-worklink/src/protocols/Aws_restJson1.ts @@ -994,7 +994,7 @@ const deserializeAws_restJson1AssociateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1050,7 +1050,7 @@ const deserializeAws_restJson1AssociateWebsiteAuthorizationProviderCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1106,7 +1106,7 @@ const deserializeAws_restJson1AssociateWebsiteCertificateAuthorityCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1162,7 +1162,7 @@ const deserializeAws_restJson1CreateFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1215,7 +1215,7 @@ const deserializeAws_restJson1DeleteFleetCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1268,7 +1268,7 @@ const deserializeAws_restJson1DescribeAuditStreamConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1327,7 +1327,7 @@ const deserializeAws_restJson1DescribeCompanyNetworkConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1404,7 +1404,7 @@ const deserializeAws_restJson1DescribeDeviceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1457,7 +1457,7 @@ const deserializeAws_restJson1DescribeDevicePolicyConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1522,7 +1522,7 @@ const deserializeAws_restJson1DescribeDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1596,7 +1596,7 @@ const deserializeAws_restJson1DescribeFleetMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1655,7 +1655,7 @@ const deserializeAws_restJson1DescribeIdentityProviderConfigurationCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1714,7 +1714,7 @@ const deserializeAws_restJson1DescribeWebsiteCertificateAuthorityCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1764,7 +1764,7 @@ const deserializeAws_restJson1DisassociateDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1814,7 +1814,7 @@ const deserializeAws_restJson1DisassociateWebsiteAuthorizationProviderCommandErr ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1867,7 +1867,7 @@ const deserializeAws_restJson1DisassociateWebsiteCertificateAuthorityCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1923,7 +1923,7 @@ const deserializeAws_restJson1ListDevicesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1979,7 +1979,7 @@ const deserializeAws_restJson1ListDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2035,7 +2035,7 @@ const deserializeAws_restJson1ListFleetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2085,7 +2085,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2132,7 +2132,7 @@ const deserializeAws_restJson1ListWebsiteAuthorizationProvidersCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2191,7 +2191,7 @@ const deserializeAws_restJson1ListWebsiteCertificateAuthoritiesCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2238,7 +2238,7 @@ const deserializeAws_restJson1RestoreDomainAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2288,7 +2288,7 @@ const deserializeAws_restJson1RevokeDomainAccessCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2338,7 +2338,7 @@ const deserializeAws_restJson1SignOutUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2388,7 +2388,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2426,7 +2426,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2464,7 +2464,7 @@ const deserializeAws_restJson1UpdateAuditStreamConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2514,7 +2514,7 @@ const deserializeAws_restJson1UpdateCompanyNetworkConfigurationCommandError = as ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2564,7 +2564,7 @@ const deserializeAws_restJson1UpdateDevicePolicyConfigurationCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2614,7 +2614,7 @@ const deserializeAws_restJson1UpdateDomainMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2664,7 +2664,7 @@ const deserializeAws_restJson1UpdateFleetMetadataCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2714,7 +2714,7 @@ const deserializeAws_restJson1UpdateIdentityProviderConfigurationCommandError = ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3066,6 +3066,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-workmail/src/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts index 0b3debe3c96a..08457ceac6e9 100644 --- a/clients/client-workmail/src/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/src/protocols/Aws_json1_1.ts @@ -1388,7 +1388,7 @@ const deserializeAws_json1_1AssociateDelegateToResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1441,7 +1441,7 @@ const deserializeAws_json1_1AssociateMemberToGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1503,7 +1503,7 @@ const deserializeAws_json1_1CancelMailboxExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1553,7 +1553,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1618,7 +1618,7 @@ const deserializeAws_json1_1CreateAvailabilityConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1671,7 +1671,7 @@ const deserializeAws_json1_1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1733,7 +1733,7 @@ const deserializeAws_json1_1CreateMobileDeviceAccessRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1783,7 +1783,7 @@ const deserializeAws_json1_1CreateOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1836,7 +1836,7 @@ const deserializeAws_json1_1CreateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1895,7 +1895,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1960,7 +1960,7 @@ const deserializeAws_json1_1DeleteAccessControlRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2004,7 +2004,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2057,7 +2057,7 @@ const deserializeAws_json1_1DeleteAvailabilityConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2101,7 +2101,7 @@ const deserializeAws_json1_1DeleteEmailMonitoringConfigurationCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2148,7 +2148,7 @@ const deserializeAws_json1_1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2207,7 +2207,7 @@ const deserializeAws_json1_1DeleteMailboxPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2260,7 +2260,7 @@ const deserializeAws_json1_1DeleteMobileDeviceAccessOverrideCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2310,7 +2310,7 @@ const deserializeAws_json1_1DeleteMobileDeviceAccessRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2357,7 +2357,7 @@ const deserializeAws_json1_1DeleteOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2404,7 +2404,7 @@ const deserializeAws_json1_1DeleteResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2454,7 +2454,7 @@ const deserializeAws_json1_1DeleteRetentionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2501,7 +2501,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2560,7 +2560,7 @@ const deserializeAws_json1_1DeregisterFromWorkMailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2613,7 +2613,7 @@ const deserializeAws_json1_1DeregisterMailDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2666,7 +2666,7 @@ const deserializeAws_json1_1DescribeEmailMonitoringConfigurationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2716,7 +2716,7 @@ const deserializeAws_json1_1DescribeGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2766,7 +2766,7 @@ const deserializeAws_json1_1DescribeInboundDmarcSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2810,7 +2810,7 @@ const deserializeAws_json1_1DescribeMailboxExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2860,7 +2860,7 @@ const deserializeAws_json1_1DescribeOrganizationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2904,7 +2904,7 @@ const deserializeAws_json1_1DescribeResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2954,7 +2954,7 @@ const deserializeAws_json1_1DescribeUserCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3004,7 +3004,7 @@ const deserializeAws_json1_1DisassociateDelegateFromResourceCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3057,7 +3057,7 @@ const deserializeAws_json1_1DisassociateMemberFromGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3119,7 +3119,7 @@ const deserializeAws_json1_1GetAccessControlEffectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3169,7 +3169,7 @@ const deserializeAws_json1_1GetDefaultRetentionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3219,7 +3219,7 @@ const deserializeAws_json1_1GetMailboxDetailsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3266,7 +3266,7 @@ const deserializeAws_json1_1GetMailDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3316,7 +3316,7 @@ const deserializeAws_json1_1GetMobileDeviceAccessEffectCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3363,7 +3363,7 @@ const deserializeAws_json1_1GetMobileDeviceAccessOverrideCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3416,7 +3416,7 @@ const deserializeAws_json1_1ListAccessControlRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3460,7 +3460,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3513,7 +3513,7 @@ const deserializeAws_json1_1ListAvailabilityConfigurationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3557,7 +3557,7 @@ const deserializeAws_json1_1ListGroupMembersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3610,7 +3610,7 @@ const deserializeAws_json1_1ListGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3660,7 +3660,7 @@ const deserializeAws_json1_1ListMailboxExportJobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3707,7 +3707,7 @@ const deserializeAws_json1_1ListMailboxPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3757,7 +3757,7 @@ const deserializeAws_json1_1ListMailDomainsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3804,7 +3804,7 @@ const deserializeAws_json1_1ListMobileDeviceAccessOverridesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3854,7 +3854,7 @@ const deserializeAws_json1_1ListMobileDeviceAccessRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3901,7 +3901,7 @@ const deserializeAws_json1_1ListOrganizationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3942,7 +3942,7 @@ const deserializeAws_json1_1ListResourceDelegatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3995,7 +3995,7 @@ const deserializeAws_json1_1ListResourcesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4042,7 +4042,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4083,7 +4083,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4130,7 +4130,7 @@ const deserializeAws_json1_1PutAccessControlRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4183,7 +4183,7 @@ const deserializeAws_json1_1PutEmailMonitoringConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4233,7 +4233,7 @@ const deserializeAws_json1_1PutInboundDmarcSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4277,7 +4277,7 @@ const deserializeAws_json1_1PutMailboxPermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4330,7 +4330,7 @@ const deserializeAws_json1_1PutMobileDeviceAccessOverrideCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4383,7 +4383,7 @@ const deserializeAws_json1_1PutRetentionPolicyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4433,7 +4433,7 @@ const deserializeAws_json1_1RegisterMailDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4486,7 +4486,7 @@ const deserializeAws_json1_1RegisterToWorkMailCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4557,7 +4557,7 @@ const deserializeAws_json1_1ResetPasswordCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4622,7 +4622,7 @@ const deserializeAws_json1_1StartMailboxExportJobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4675,7 +4675,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4722,7 +4722,7 @@ const deserializeAws_json1_1TestAvailabilityConfigurationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4772,7 +4772,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4813,7 +4813,7 @@ const deserializeAws_json1_1UpdateAvailabilityConfigurationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4863,7 +4863,7 @@ const deserializeAws_json1_1UpdateDefaultMailDomainCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4916,7 +4916,7 @@ const deserializeAws_json1_1UpdateMailboxQuotaCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4969,7 +4969,7 @@ const deserializeAws_json1_1UpdateMobileDeviceAccessRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5019,7 +5019,7 @@ const deserializeAws_json1_1UpdatePrimaryEmailAddressCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -5090,7 +5090,7 @@ const deserializeAws_json1_1UpdateResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7888,6 +7888,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts index 0cb634286d60..1f9dad239dfb 100644 --- a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts @@ -97,7 +97,7 @@ const deserializeAws_restJson1GetRawMessageContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -135,7 +135,7 @@ const deserializeAws_restJson1PutRawMessageContentCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -275,6 +275,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts index 40afe3ddeedd..6a46374d46bb 100644 --- a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts +++ b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts @@ -1404,7 +1404,7 @@ const deserializeAws_restJson1AssociateBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1463,7 +1463,7 @@ const deserializeAws_restJson1AssociateNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1522,7 +1522,7 @@ const deserializeAws_restJson1AssociateTrustStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1578,7 +1578,7 @@ const deserializeAws_restJson1AssociateUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1634,7 +1634,7 @@ const deserializeAws_restJson1CreateBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1693,7 +1693,7 @@ const deserializeAws_restJson1CreateIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1752,7 +1752,7 @@ const deserializeAws_restJson1CreateNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1811,7 +1811,7 @@ const deserializeAws_restJson1CreatePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1870,7 +1870,7 @@ const deserializeAws_restJson1CreateTrustStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1926,7 +1926,7 @@ const deserializeAws_restJson1CreateUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1979,7 +1979,7 @@ const deserializeAws_restJson1DeleteBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2029,7 +2029,7 @@ const deserializeAws_restJson1DeleteIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2079,7 +2079,7 @@ const deserializeAws_restJson1DeleteNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2129,7 +2129,7 @@ const deserializeAws_restJson1DeletePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2179,7 +2179,7 @@ const deserializeAws_restJson1DeleteTrustStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2229,7 +2229,7 @@ const deserializeAws_restJson1DeleteUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2279,7 +2279,7 @@ const deserializeAws_restJson1DisassociateBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2329,7 +2329,7 @@ const deserializeAws_restJson1DisassociateNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2379,7 +2379,7 @@ const deserializeAws_restJson1DisassociateTrustStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2429,7 +2429,7 @@ const deserializeAws_restJson1DisassociateUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2482,7 +2482,7 @@ const deserializeAws_restJson1GetBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2535,7 +2535,7 @@ const deserializeAws_restJson1GetIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2588,7 +2588,7 @@ const deserializeAws_restJson1GetNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2641,7 +2641,7 @@ const deserializeAws_restJson1GetPortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2697,7 +2697,7 @@ const deserializeAws_restJson1GetPortalServiceProviderMetadataCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2750,7 +2750,7 @@ const deserializeAws_restJson1GetTrustStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2806,7 +2806,7 @@ const deserializeAws_restJson1GetTrustStoreCertificateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2859,7 +2859,7 @@ const deserializeAws_restJson1GetUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2915,7 +2915,7 @@ const deserializeAws_restJson1ListBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2968,7 +2968,7 @@ const deserializeAws_restJson1ListIdentityProvidersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3021,7 +3021,7 @@ const deserializeAws_restJson1ListNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3074,7 +3074,7 @@ const deserializeAws_restJson1ListPortalsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3124,7 +3124,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3183,7 +3183,7 @@ const deserializeAws_restJson1ListTrustStoreCertificatesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3239,7 +3239,7 @@ const deserializeAws_restJson1ListTrustStoresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3292,7 +3292,7 @@ const deserializeAws_restJson1ListUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3339,7 +3339,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3392,7 +3392,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3445,7 +3445,7 @@ const deserializeAws_restJson1UpdateBrowserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3498,7 +3498,7 @@ const deserializeAws_restJson1UpdateIdentityProviderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3551,7 +3551,7 @@ const deserializeAws_restJson1UpdateNetworkSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3604,7 +3604,7 @@ const deserializeAws_restJson1UpdatePortalCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3657,7 +3657,7 @@ const deserializeAws_restJson1UpdateTrustStoreCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3713,7 +3713,7 @@ const deserializeAws_restJson1UpdateUserSettingsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4401,6 +4401,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-workspaces/src/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts index 8e4a8d4ebc02..694b68afcc0b 100644 --- a/clients/client-workspaces/src/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/src/protocols/Aws_json1_1.ts @@ -1239,7 +1239,7 @@ const deserializeAws_json1_1AssociateConnectionAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1295,7 +1295,7 @@ const deserializeAws_json1_1AssociateIpGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1351,7 +1351,7 @@ const deserializeAws_json1_1AuthorizeIpRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1404,7 +1404,7 @@ const deserializeAws_json1_1CopyWorkspaceImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1463,7 +1463,7 @@ const deserializeAws_json1_1CreateConnectClientAddInCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1516,7 +1516,7 @@ const deserializeAws_json1_1CreateConnectionAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1572,7 +1572,7 @@ const deserializeAws_json1_1CreateIpGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1625,7 +1625,7 @@ const deserializeAws_json1_1CreateTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1672,7 +1672,7 @@ const deserializeAws_json1_1CreateUpdatedWorkspaceImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1731,7 +1731,7 @@ const deserializeAws_json1_1CreateWorkspaceBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1787,7 +1787,7 @@ const deserializeAws_json1_1CreateWorkspaceImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1846,7 +1846,7 @@ const deserializeAws_json1_1CreateWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1890,7 +1890,7 @@ const deserializeAws_json1_1DeleteClientBrandingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1937,7 +1937,7 @@ const deserializeAws_json1_1DeleteConnectClientAddInCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1984,7 +1984,7 @@ const deserializeAws_json1_1DeleteConnectionAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2040,7 +2040,7 @@ const deserializeAws_json1_1DeleteIpGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2090,7 +2090,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2134,7 +2134,7 @@ const deserializeAws_json1_1DeleteWorkspaceBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2184,7 +2184,7 @@ const deserializeAws_json1_1DeleteWorkspaceImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2231,7 +2231,7 @@ const deserializeAws_json1_1DeregisterWorkspaceDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2284,7 +2284,7 @@ const deserializeAws_json1_1DescribeAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2325,7 +2325,7 @@ const deserializeAws_json1_1DescribeAccountModificationsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2366,7 +2366,7 @@ const deserializeAws_json1_1DescribeClientBrandingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2413,7 +2413,7 @@ const deserializeAws_json1_1DescribeClientPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2460,7 +2460,7 @@ const deserializeAws_json1_1DescribeConnectClientAddInsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2507,7 +2507,7 @@ const deserializeAws_json1_1DescribeConnectionAliasesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2554,7 +2554,7 @@ const deserializeAws_json1_1DescribeConnectionAliasPermissionsCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2604,7 +2604,7 @@ const deserializeAws_json1_1DescribeIpGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2648,7 +2648,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2689,7 +2689,7 @@ const deserializeAws_json1_1DescribeWorkspaceBundlesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2730,7 +2730,7 @@ const deserializeAws_json1_1DescribeWorkspaceDirectoriesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2771,7 +2771,7 @@ const deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2818,7 +2818,7 @@ const deserializeAws_json1_1DescribeWorkspaceImagesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2859,7 +2859,7 @@ const deserializeAws_json1_1DescribeWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2903,7 +2903,7 @@ const deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2944,7 +2944,7 @@ const deserializeAws_json1_1DescribeWorkspaceSnapshotsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2991,7 +2991,7 @@ const deserializeAws_json1_1DisassociateConnectionAliasCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3044,7 +3044,7 @@ const deserializeAws_json1_1DisassociateIpGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3094,7 +3094,7 @@ const deserializeAws_json1_1ImportClientBrandingCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3144,7 +3144,7 @@ const deserializeAws_json1_1ImportWorkspaceImageCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3200,7 +3200,7 @@ const deserializeAws_json1_1ListAvailableManagementCidrRangesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3244,7 +3244,7 @@ const deserializeAws_json1_1MigrateWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3300,7 +3300,7 @@ const deserializeAws_json1_1ModifyAccountCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3353,7 +3353,7 @@ const deserializeAws_json1_1ModifyClientPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3400,7 +3400,7 @@ const deserializeAws_json1_1ModifySamlPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3450,7 +3450,7 @@ const deserializeAws_json1_1ModifySelfservicePermissionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3497,7 +3497,7 @@ const deserializeAws_json1_1ModifyWorkspaceAccessPropertiesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3541,7 +3541,7 @@ const deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3591,7 +3591,7 @@ const deserializeAws_json1_1ModifyWorkspacePropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3650,7 +3650,7 @@ const deserializeAws_json1_1ModifyWorkspaceStateCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3697,7 +3697,7 @@ const deserializeAws_json1_1RebootWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3732,7 +3732,7 @@ const deserializeAws_json1_1RebuildWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3767,7 +3767,7 @@ const deserializeAws_json1_1RegisterWorkspaceDirectoryCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3829,7 +3829,7 @@ const deserializeAws_json1_1RestoreWorkspaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3876,7 +3876,7 @@ const deserializeAws_json1_1RevokeIpRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3926,7 +3926,7 @@ const deserializeAws_json1_1StartWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3961,7 +3961,7 @@ const deserializeAws_json1_1StopWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3996,7 +3996,7 @@ const deserializeAws_json1_1TerminateWorkspacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4031,7 +4031,7 @@ const deserializeAws_json1_1UpdateConnectClientAddInCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4078,7 +4078,7 @@ const deserializeAws_json1_1UpdateConnectionAliasPermissionCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4137,7 +4137,7 @@ const deserializeAws_json1_1UpdateRulesOfIpGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4190,7 +4190,7 @@ const deserializeAws_json1_1UpdateWorkspaceBundleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -4240,7 +4240,7 @@ const deserializeAws_json1_1UpdateWorkspaceImagePermissionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -7022,6 +7022,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/clients/client-xray/src/protocols/Aws_restJson1.ts b/clients/client-xray/src/protocols/Aws_restJson1.ts index 3e1472db2c6e..c8d3430b6ab9 100644 --- a/clients/client-xray/src/protocols/Aws_restJson1.ts +++ b/clients/client-xray/src/protocols/Aws_restJson1.ts @@ -881,7 +881,7 @@ const deserializeAws_restJson1BatchGetTracesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -925,7 +925,7 @@ const deserializeAws_restJson1CreateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -969,7 +969,7 @@ const deserializeAws_restJson1CreateSamplingRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1013,7 +1013,7 @@ const deserializeAws_restJson1DeleteGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1057,7 +1057,7 @@ const deserializeAws_restJson1DeleteSamplingRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1101,7 +1101,7 @@ const deserializeAws_restJson1GetEncryptionConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1145,7 +1145,7 @@ const deserializeAws_restJson1GetGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1192,7 +1192,7 @@ const deserializeAws_restJson1GetGroupsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1236,7 +1236,7 @@ const deserializeAws_restJson1GetInsightCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1283,7 +1283,7 @@ const deserializeAws_restJson1GetInsightEventsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1345,7 +1345,7 @@ const deserializeAws_restJson1GetInsightImpactGraphCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1392,7 +1392,7 @@ const deserializeAws_restJson1GetInsightSummariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1439,7 +1439,7 @@ const deserializeAws_restJson1GetSamplingRulesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1489,7 +1489,7 @@ const deserializeAws_restJson1GetSamplingStatisticSummariesCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1545,7 +1545,7 @@ const deserializeAws_restJson1GetSamplingTargetsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1601,7 +1601,7 @@ const deserializeAws_restJson1GetServiceGraphCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1654,7 +1654,7 @@ const deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1701,7 +1701,7 @@ const deserializeAws_restJson1GetTraceGraphCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1754,7 +1754,7 @@ const deserializeAws_restJson1GetTraceSummariesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1801,7 +1801,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1848,7 +1848,7 @@ const deserializeAws_restJson1PutEncryptionConfigCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1889,7 +1889,7 @@ const deserializeAws_restJson1PutTelemetryRecordsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1936,7 +1936,7 @@ const deserializeAws_restJson1PutTraceSegmentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -1977,7 +1977,7 @@ const deserializeAws_restJson1TagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2024,7 +2024,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2071,7 +2071,7 @@ const deserializeAws_restJson1UpdateGroupCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2115,7 +2115,7 @@ const deserializeAws_restJson1UpdateSamplingRuleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3612,6 +3612,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/private/aws-echo-service/src/protocols/Aws_restJson1.ts b/private/aws-echo-service/src/protocols/Aws_restJson1.ts index c6ffcedb2935..a58e2900d5fa 100644 --- a/private/aws-echo-service/src/protocols/Aws_restJson1.ts +++ b/private/aws-echo-service/src/protocols/Aws_restJson1.ts @@ -88,7 +88,7 @@ const deserializeAws_restJson1EchoCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -129,7 +129,7 @@ const deserializeAws_restJson1LengthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -198,6 +198,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts index 95e8754ab575..fd6527a865c2 100644 --- a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts +++ b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts @@ -454,7 +454,7 @@ const deserializeAws_ec2EmptyInputAndEmptyOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -486,7 +486,7 @@ const deserializeAws_ec2EndpointOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -518,7 +518,7 @@ const deserializeAws_ec2EndpointWithHostLabelOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -553,7 +553,7 @@ const deserializeAws_ec2GreetingWithErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -594,7 +594,7 @@ const deserializeAws_ec2HostWithPathOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -629,7 +629,7 @@ const deserializeAws_ec2IgnoresWrappingXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -661,7 +661,7 @@ const deserializeAws_ec2NestedStructuresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -696,7 +696,7 @@ const deserializeAws_ec2NoInputAndOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -728,7 +728,7 @@ const deserializeAws_ec2QueryIdempotencyTokenAutoFillCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -760,7 +760,7 @@ const deserializeAws_ec2QueryListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -792,7 +792,7 @@ const deserializeAws_ec2QueryTimestampsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -827,7 +827,7 @@ const deserializeAws_ec2RecursiveXmlShapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -859,7 +859,7 @@ const deserializeAws_ec2SimpleInputParamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -894,7 +894,7 @@ const deserializeAws_ec2SimpleScalarXmlPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -929,7 +929,7 @@ const deserializeAws_ec2XmlBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -964,7 +964,7 @@ const deserializeAws_ec2XmlEmptyBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -999,7 +999,7 @@ const deserializeAws_ec2XmlEmptyListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1034,7 +1034,7 @@ const deserializeAws_ec2XmlEnumsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1069,7 +1069,7 @@ const deserializeAws_ec2XmlListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1104,7 +1104,7 @@ const deserializeAws_ec2XmlNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1139,7 +1139,7 @@ const deserializeAws_ec2XmlTimestampsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1961,6 +1961,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts index 173fef176db4..e353795c22d1 100644 --- a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts +++ b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts @@ -221,7 +221,7 @@ const deserializeAws_json1_0EmptyInputAndEmptyOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -253,7 +253,7 @@ const deserializeAws_json1_0EndpointOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -285,7 +285,7 @@ const deserializeAws_json1_0EndpointWithHostLabelOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -320,7 +320,7 @@ const deserializeAws_json1_0GreetingWithErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -364,7 +364,7 @@ const deserializeAws_json1_0HostWithPathOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -399,7 +399,7 @@ const deserializeAws_json1_0JsonUnionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -431,7 +431,7 @@ const deserializeAws_json1_0NoInputAndNoOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -466,7 +466,7 @@ const deserializeAws_json1_0NoInputAndOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -501,7 +501,7 @@ const deserializeAws_json1_0SimpleScalarPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -814,6 +814,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts index 8d27cf55d9b3..5d30c0aaf59d 100644 --- a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts +++ b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts @@ -278,7 +278,7 @@ const deserializeAws_json1_1EmptyOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -310,7 +310,7 @@ const deserializeAws_json1_1EndpointOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -342,7 +342,7 @@ const deserializeAws_json1_1EndpointWithHostLabelOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -377,7 +377,7 @@ const deserializeAws_json1_1GreetingWithErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -421,7 +421,7 @@ const deserializeAws_json1_1HostWithPathOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -456,7 +456,7 @@ const deserializeAws_json1_1JsonEnumsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -491,7 +491,7 @@ const deserializeAws_json1_1JsonUnionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -526,7 +526,7 @@ const deserializeAws_json1_1KitchenSinkOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -570,7 +570,7 @@ const deserializeAws_json1_1NullOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -605,7 +605,7 @@ const deserializeAws_json1_1OperationWithOptionalInputOutputCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -640,7 +640,7 @@ const deserializeAws_json1_1PutAndGetInlineDocumentsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -675,7 +675,7 @@ const deserializeAws_json1_1SimpleScalarPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1581,6 +1581,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/private/aws-protocoltests-query/src/protocols/Aws_query.ts b/private/aws-protocoltests-query/src/protocols/Aws_query.ts index ad22f5deb208..6a222855a740 100644 --- a/private/aws-protocoltests-query/src/protocols/Aws_query.ts +++ b/private/aws-protocoltests-query/src/protocols/Aws_query.ts @@ -593,7 +593,7 @@ const deserializeAws_queryEmptyInputAndEmptyOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -625,7 +625,7 @@ const deserializeAws_queryEndpointOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -657,7 +657,7 @@ const deserializeAws_queryEndpointWithHostLabelOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -692,7 +692,7 @@ const deserializeAws_queryFlattenedXmlMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -727,7 +727,7 @@ const deserializeAws_queryFlattenedXmlMapWithXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -765,7 +765,7 @@ const deserializeAws_queryFlattenedXmlMapWithXmlNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -800,7 +800,7 @@ const deserializeAws_queryGreetingWithErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -844,7 +844,7 @@ const deserializeAws_queryHostWithPathOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -879,7 +879,7 @@ const deserializeAws_queryIgnoresWrappingXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -911,7 +911,7 @@ const deserializeAws_queryNestedStructuresCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -943,7 +943,7 @@ const deserializeAws_queryNoInputAndNoOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -978,7 +978,7 @@ const deserializeAws_queryNoInputAndOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1010,7 +1010,7 @@ const deserializeAws_queryQueryIdempotencyTokenAutoFillCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1042,7 +1042,7 @@ const deserializeAws_queryQueryListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1074,7 +1074,7 @@ const deserializeAws_queryQueryMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1106,7 +1106,7 @@ const deserializeAws_queryQueryTimestampsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1141,7 +1141,7 @@ const deserializeAws_queryRecursiveXmlShapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1173,7 +1173,7 @@ const deserializeAws_querySimpleInputParamsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1208,7 +1208,7 @@ const deserializeAws_querySimpleScalarXmlPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1243,7 +1243,7 @@ const deserializeAws_queryXmlBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1278,7 +1278,7 @@ const deserializeAws_queryXmlEmptyBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1313,7 +1313,7 @@ const deserializeAws_queryXmlEmptyListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1348,7 +1348,7 @@ const deserializeAws_queryXmlEmptyMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1383,7 +1383,7 @@ const deserializeAws_queryXmlEnumsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1418,7 +1418,7 @@ const deserializeAws_queryXmlListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1453,7 +1453,7 @@ const deserializeAws_queryXmlMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1488,7 +1488,7 @@ const deserializeAws_queryXmlMapsXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1523,7 +1523,7 @@ const deserializeAws_queryXmlNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -1558,7 +1558,7 @@ const deserializeAws_queryXmlTimestampsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2697,6 +2697,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const buildFormUrlencodedString = (formEntries: Record): string => Object.entries(formEntries) .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts index b35b4715ed72..b7113cdfc425 100644 --- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts +++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts @@ -2812,7 +2812,7 @@ const deserializeAws_restJson1AllQueryStringTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2844,7 +2844,7 @@ const deserializeAws_restJson1ConstantAndVariableQueryStringCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2876,7 +2876,7 @@ const deserializeAws_restJson1ConstantQueryStringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2914,7 +2914,7 @@ const deserializeAws_restJson1DocumentTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2948,7 +2948,7 @@ const deserializeAws_restJson1DocumentTypeAsPayloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2980,7 +2980,7 @@ const deserializeAws_restJson1EmptyInputAndEmptyOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3012,7 +3012,7 @@ const deserializeAws_restJson1EndpointOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3044,7 +3044,7 @@ const deserializeAws_restJson1EndpointWithHostLabelOperationCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3077,7 +3077,7 @@ const deserializeAws_restJson1GreetingWithErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -3121,7 +3121,7 @@ const deserializeAws_restJson1HostWithPathOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3156,7 +3156,7 @@ const deserializeAws_restJson1HttpChecksumRequiredCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3189,7 +3189,7 @@ const deserializeAws_restJson1HttpEnumPayloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3223,7 +3223,7 @@ const deserializeAws_restJson1HttpPayloadTraitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3257,7 +3257,7 @@ const deserializeAws_restJson1HttpPayloadTraitsWithMediaTypeCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3290,7 +3290,7 @@ const deserializeAws_restJson1HttpPayloadWithStructureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3332,7 +3332,7 @@ const deserializeAws_restJson1HttpPrefixHeadersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3373,7 +3373,7 @@ const deserializeAws_restJson1HttpPrefixHeadersInResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3405,7 +3405,7 @@ const deserializeAws_restJson1HttpRequestWithFloatLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3437,7 +3437,7 @@ const deserializeAws_restJson1HttpRequestWithGreedyLabelInPathCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3469,7 +3469,7 @@ const deserializeAws_restJson1HttpRequestWithLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3501,7 +3501,7 @@ const deserializeAws_restJson1HttpRequestWithLabelsAndTimestampFormatCommandErro ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3533,7 +3533,7 @@ const deserializeAws_restJson1HttpRequestWithRegexLiteralCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3568,7 +3568,7 @@ const deserializeAws_restJson1HttpResponseCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3601,7 +3601,7 @@ const deserializeAws_restJson1HttpStringPayloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3636,7 +3636,7 @@ const deserializeAws_restJson1IgnoreQueryParamsInResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3712,7 +3712,7 @@ const deserializeAws_restJson1InputAndOutputWithHeadersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3747,7 +3747,7 @@ const deserializeAws_restJson1JsonBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3797,7 +3797,7 @@ const deserializeAws_restJson1JsonEnumsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3856,7 +3856,7 @@ const deserializeAws_restJson1JsonListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3918,7 +3918,7 @@ const deserializeAws_restJson1JsonMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3962,7 +3962,7 @@ const deserializeAws_restJson1JsonTimestampsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3997,7 +3997,7 @@ const deserializeAws_restJson1JsonUnionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4032,7 +4032,7 @@ const deserializeAws_restJson1MalformedAcceptWithBodyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4065,7 +4065,7 @@ const deserializeAws_restJson1MalformedAcceptWithGenericStringCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4098,7 +4098,7 @@ const deserializeAws_restJson1MalformedAcceptWithPayloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4130,7 +4130,7 @@ const deserializeAws_restJson1MalformedBlobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4162,7 +4162,7 @@ const deserializeAws_restJson1MalformedBooleanCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4194,7 +4194,7 @@ const deserializeAws_restJson1MalformedByteCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4226,7 +4226,7 @@ const deserializeAws_restJson1MalformedContentTypeWithBodyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4258,7 +4258,7 @@ const deserializeAws_restJson1MalformedContentTypeWithGenericStringCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4290,7 +4290,7 @@ const deserializeAws_restJson1MalformedContentTypeWithoutBodyCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4322,7 +4322,7 @@ const deserializeAws_restJson1MalformedContentTypeWithPayloadCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4354,7 +4354,7 @@ const deserializeAws_restJson1MalformedDoubleCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4386,7 +4386,7 @@ const deserializeAws_restJson1MalformedFloatCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4418,7 +4418,7 @@ const deserializeAws_restJson1MalformedIntegerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4450,7 +4450,7 @@ const deserializeAws_restJson1MalformedListCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4482,7 +4482,7 @@ const deserializeAws_restJson1MalformedLongCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4514,7 +4514,7 @@ const deserializeAws_restJson1MalformedMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4546,7 +4546,7 @@ const deserializeAws_restJson1MalformedRequestBodyCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4578,7 +4578,7 @@ const deserializeAws_restJson1MalformedShortCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4610,7 +4610,7 @@ const deserializeAws_restJson1MalformedStringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4642,7 +4642,7 @@ const deserializeAws_restJson1MalformedTimestampBodyDateTimeCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4674,7 +4674,7 @@ const deserializeAws_restJson1MalformedTimestampBodyDefaultCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4706,7 +4706,7 @@ const deserializeAws_restJson1MalformedTimestampBodyHttpDateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4738,7 +4738,7 @@ const deserializeAws_restJson1MalformedTimestampHeaderDateTimeCommandError = asy ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4770,7 +4770,7 @@ const deserializeAws_restJson1MalformedTimestampHeaderDefaultCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4802,7 +4802,7 @@ const deserializeAws_restJson1MalformedTimestampHeaderEpochCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4834,7 +4834,7 @@ const deserializeAws_restJson1MalformedTimestampPathDefaultCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4866,7 +4866,7 @@ const deserializeAws_restJson1MalformedTimestampPathEpochCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4898,7 +4898,7 @@ const deserializeAws_restJson1MalformedTimestampPathHttpDateCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4930,7 +4930,7 @@ const deserializeAws_restJson1MalformedTimestampQueryDefaultCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4962,7 +4962,7 @@ const deserializeAws_restJson1MalformedTimestampQueryEpochCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4994,7 +4994,7 @@ const deserializeAws_restJson1MalformedTimestampQueryHttpDateCommandError = asyn ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5026,7 +5026,7 @@ const deserializeAws_restJson1MalformedUnionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5062,7 +5062,7 @@ const deserializeAws_restJson1MediaTypeHeaderCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5094,7 +5094,7 @@ const deserializeAws_restJson1NoInputAndNoOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5126,7 +5126,7 @@ const deserializeAws_restJson1NoInputAndOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5164,7 +5164,7 @@ const deserializeAws_restJson1NullAndEmptyHeadersClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5202,7 +5202,7 @@ const deserializeAws_restJson1NullAndEmptyHeadersServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5234,7 +5234,7 @@ const deserializeAws_restJson1OmitsNullSerializesEmptyStringCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5269,7 +5269,7 @@ const deserializeAws_restJson1PostPlayerActionCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5304,7 +5304,7 @@ const deserializeAws_restJson1PostUnionWithJsonNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5336,7 +5336,7 @@ const deserializeAws_restJson1QueryIdempotencyTokenAutoFillCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5368,7 +5368,7 @@ const deserializeAws_restJson1QueryParamsAsStringListMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5400,7 +5400,7 @@ const deserializeAws_restJson1QueryPrecedenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5435,7 +5435,7 @@ const deserializeAws_restJson1RecursiveShapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5495,7 +5495,7 @@ const deserializeAws_restJson1SimpleScalarPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5529,7 +5529,7 @@ const deserializeAws_restJson1StreamingTraitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5561,7 +5561,7 @@ const deserializeAws_restJson1StreamingTraitsRequireLengthCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5595,7 +5595,7 @@ const deserializeAws_restJson1StreamingTraitsWithMediaTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5631,7 +5631,7 @@ const deserializeAws_restJson1TestBodyStructureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5664,7 +5664,7 @@ const deserializeAws_restJson1TestNoPayloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5698,7 +5698,7 @@ const deserializeAws_restJson1TestPayloadBlobCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5732,7 +5732,7 @@ const deserializeAws_restJson1TestPayloadStructureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5792,7 +5792,7 @@ const deserializeAws_restJson1TimestampFormatHeadersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5824,7 +5824,7 @@ const deserializeAws_restJson1UnitInputAndOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -6695,6 +6695,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + /** * Load an error code for the aws.rest-json-1.1 protocol. */ diff --git a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts index 3b614822ca58..a42a8607fc9d 100644 --- a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts +++ b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts @@ -2177,7 +2177,7 @@ const deserializeAws_restXmlAllQueryStringTypesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2212,7 +2212,7 @@ const deserializeAws_restXmlBodyWithXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2244,7 +2244,7 @@ const deserializeAws_restXmlConstantAndVariableQueryStringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2276,7 +2276,7 @@ const deserializeAws_restXmlConstantQueryStringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2308,7 +2308,7 @@ const deserializeAws_restXmlEmptyInputAndEmptyOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2340,7 +2340,7 @@ const deserializeAws_restXmlEndpointOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2372,7 +2372,7 @@ const deserializeAws_restXmlEndpointWithHostLabelHeaderOperationCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2404,7 +2404,7 @@ const deserializeAws_restXmlEndpointWithHostLabelOperationCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2441,7 +2441,7 @@ const deserializeAws_restXmlFlattenedXmlMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2481,7 +2481,7 @@ const deserializeAws_restXmlFlattenedXmlMapWithXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2521,7 +2521,7 @@ const deserializeAws_restXmlFlattenedXmlMapWithXmlNamespaceCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2554,7 +2554,7 @@ const deserializeAws_restXmlGreetingWithErrorsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { @@ -2597,7 +2597,7 @@ const deserializeAws_restXmlHttpPayloadTraitsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2631,7 +2631,7 @@ const deserializeAws_restXmlHttpPayloadTraitsWithMediaTypeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2664,7 +2664,7 @@ const deserializeAws_restXmlHttpPayloadWithMemberXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2697,7 +2697,7 @@ const deserializeAws_restXmlHttpPayloadWithStructureCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2730,7 +2730,7 @@ const deserializeAws_restXmlHttpPayloadWithXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2763,7 +2763,7 @@ const deserializeAws_restXmlHttpPayloadWithXmlNamespaceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2796,7 +2796,7 @@ const deserializeAws_restXmlHttpPayloadWithXmlNamespaceAndPrefixCommandError = a ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2838,7 +2838,7 @@ const deserializeAws_restXmlHttpPrefixHeadersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2870,7 +2870,7 @@ const deserializeAws_restXmlHttpRequestWithFloatLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2902,7 +2902,7 @@ const deserializeAws_restXmlHttpRequestWithGreedyLabelInPathCommandError = async ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2934,7 +2934,7 @@ const deserializeAws_restXmlHttpRequestWithLabelsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -2966,7 +2966,7 @@ const deserializeAws_restXmlHttpRequestWithLabelsAndTimestampFormatCommandError ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3001,7 +3001,7 @@ const deserializeAws_restXmlHttpResponseCodeCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3036,7 +3036,7 @@ const deserializeAws_restXmlIgnoreQueryParamsInResponseCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3112,7 +3112,7 @@ const deserializeAws_restXmlInputAndOutputWithHeadersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3154,7 +3154,7 @@ const deserializeAws_restXmlNestedXmlMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3186,7 +3186,7 @@ const deserializeAws_restXmlNoInputAndNoOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3218,7 +3218,7 @@ const deserializeAws_restXmlNoInputAndOutputCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3256,7 +3256,7 @@ const deserializeAws_restXmlNullAndEmptyHeadersClientCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3294,7 +3294,7 @@ const deserializeAws_restXmlNullAndEmptyHeadersServerCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3326,7 +3326,7 @@ const deserializeAws_restXmlOmitsNullSerializesEmptyStringCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3358,7 +3358,7 @@ const deserializeAws_restXmlQueryIdempotencyTokenAutoFillCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3390,7 +3390,7 @@ const deserializeAws_restXmlQueryParamsAsStringListMapCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3422,7 +3422,7 @@ const deserializeAws_restXmlQueryPrecedenceCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3457,7 +3457,7 @@ const deserializeAws_restXmlRecursiveShapesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3517,7 +3517,7 @@ const deserializeAws_restXmlSimpleScalarPropertiesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3577,7 +3577,7 @@ const deserializeAws_restXmlTimestampFormatHeadersCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3615,7 +3615,7 @@ const deserializeAws_restXmlXmlAttributesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3648,7 +3648,7 @@ const deserializeAws_restXmlXmlAttributesOnPayloadCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3683,7 +3683,7 @@ const deserializeAws_restXmlXmlBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3718,7 +3718,7 @@ const deserializeAws_restXmlXmlEmptyBlobsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3856,7 +3856,7 @@ const deserializeAws_restXmlXmlEmptyListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3896,7 +3896,7 @@ const deserializeAws_restXmlXmlEmptyMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3931,7 +3931,7 @@ const deserializeAws_restXmlXmlEmptyStringsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -3996,7 +3996,7 @@ const deserializeAws_restXmlXmlEnumsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4134,7 +4134,7 @@ const deserializeAws_restXmlXmlListsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4174,7 +4174,7 @@ const deserializeAws_restXmlXmlMapsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4214,7 +4214,7 @@ const deserializeAws_restXmlXmlMapsXmlNameCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4249,7 +4249,7 @@ const deserializeAws_restXmlXmlNamespacesCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4293,7 +4293,7 @@ const deserializeAws_restXmlXmlTimestampsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -4330,7 +4330,7 @@ const deserializeAws_restXmlXmlUnionsCommandError = async ( ): Promise => { const parsedOutput: any = { ...output, - body: await parseBody(output.body, context), + body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); const parsedBody = parsedOutput.body; @@ -5300,6 +5300,12 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => return {}; }); +const parseErrorBody = (errorBody: any, context: __SerdeContext): any => { + const value = parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + const loadRestXmlErrorCode = (output: __HttpResponse, data: any): string | undefined => { if (data.Error.Code !== undefined) { return data.Error.Code;