Skip to content

Commit c2d8522

Browse files
fix(codegen): fix error code parsing when it's a number (#3371)
* fix(codegen): fix error code parsing * fix(codegen): generate all clients
1 parent 0dd60ed commit c2d8522

File tree

281 files changed

+1124
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+1124
-281
lines changed

clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4047,8 +4047,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
40474047
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
40484048
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
40494049

4050-
const sanitizeErrorCode = (rawValue: string): string => {
4050+
const sanitizeErrorCode = (rawValue: string | number): string => {
40514051
let cleanValue = rawValue;
4052+
if (typeof cleanValue === "number") {
4053+
cleanValue = cleanValue.toString();
4054+
}
40524055
if (cleanValue.indexOf(":") >= 0) {
40534056
cleanValue = cleanValue.split(":")[0];
40544057
}

clients/client-account/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
404404
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
405405
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
406406

407-
const sanitizeErrorCode = (rawValue: string): string => {
407+
const sanitizeErrorCode = (rawValue: string | number): string => {
408408
let cleanValue = rawValue;
409+
if (typeof cleanValue === "number") {
410+
cleanValue = cleanValue.toString();
411+
}
409412
if (cleanValue.indexOf(":") >= 0) {
410413
cleanValue = cleanValue.split(":")[0];
411414
}

clients/client-acm-pca/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3083,8 +3083,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
30833083
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
30843084
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
30853085

3086-
const sanitizeErrorCode = (rawValue: string): string => {
3086+
const sanitizeErrorCode = (rawValue: string | number): string => {
30873087
let cleanValue = rawValue;
3088+
if (typeof cleanValue === "number") {
3089+
cleanValue = cleanValue.toString();
3090+
}
30883091
if (cleanValue.indexOf(":") >= 0) {
30893092
cleanValue = cleanValue.split(":")[0];
30903093
}

clients/client-acm/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2019,8 +2019,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
20192019
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
20202020
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
20212021

2022-
const sanitizeErrorCode = (rawValue: string): string => {
2022+
const sanitizeErrorCode = (rawValue: string | number): string => {
20232023
let cleanValue = rawValue;
2024+
if (typeof cleanValue === "number") {
2025+
cleanValue = cleanValue.toString();
2026+
}
20242027
if (cleanValue.indexOf(":") >= 0) {
20252028
cleanValue = cleanValue.split(":")[0];
20262029
}

clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9243,8 +9243,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
92439243
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
92449244
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
92459245

9246-
const sanitizeErrorCode = (rawValue: string): string => {
9246+
const sanitizeErrorCode = (rawValue: string | number): string => {
92479247
let cleanValue = rawValue;
9248+
if (typeof cleanValue === "number") {
9249+
cleanValue = cleanValue.toString();
9250+
}
92489251
if (cleanValue.indexOf(":") >= 0) {
92499252
cleanValue = cleanValue.split(":")[0];
92509253
}

clients/client-amp/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2073,8 +2073,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
20732073
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
20742074
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
20752075

2076-
const sanitizeErrorCode = (rawValue: string): string => {
2076+
const sanitizeErrorCode = (rawValue: string | number): string => {
20772077
let cleanValue = rawValue;
2078+
if (typeof cleanValue === "number") {
2079+
cleanValue = cleanValue.toString();
2080+
}
20782081
if (cleanValue.indexOf(":") >= 0) {
20792082
cleanValue = cleanValue.split(":")[0];
20802083
}

clients/client-amplify/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4366,8 +4366,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
43664366
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
43674367
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
43684368

4369-
const sanitizeErrorCode = (rawValue: string): string => {
4369+
const sanitizeErrorCode = (rawValue: string | number): string => {
43704370
let cleanValue = rawValue;
4371+
if (typeof cleanValue === "number") {
4372+
cleanValue = cleanValue.toString();
4373+
}
43714374
if (cleanValue.indexOf(":") >= 0) {
43724375
cleanValue = cleanValue.split(":")[0];
43734376
}

clients/client-amplifybackend/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4618,8 +4618,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
46184618
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
46194619
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
46204620

4621-
const sanitizeErrorCode = (rawValue: string): string => {
4621+
const sanitizeErrorCode = (rawValue: string | number): string => {
46224622
let cleanValue = rawValue;
4623+
if (typeof cleanValue === "number") {
4624+
cleanValue = cleanValue.toString();
4625+
}
46234626
if (cleanValue.indexOf(":") >= 0) {
46244627
cleanValue = cleanValue.split(":")[0];
46254628
}

clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2562,8 +2562,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
25622562
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
25632563
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
25642564

2565-
const sanitizeErrorCode = (rawValue: string): string => {
2565+
const sanitizeErrorCode = (rawValue: string | number): string => {
25662566
let cleanValue = rawValue;
2567+
if (typeof cleanValue === "number") {
2568+
cleanValue = cleanValue.toString();
2569+
}
25672570
if (cleanValue.indexOf(":") >= 0) {
25682571
cleanValue = cleanValue.split(":")[0];
25692572
}

clients/client-api-gateway/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15094,8 +15094,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
1509415094
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
1509515095
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1509615096

15097-
const sanitizeErrorCode = (rawValue: string): string => {
15097+
const sanitizeErrorCode = (rawValue: string | number): string => {
1509815098
let cleanValue = rawValue;
15099+
if (typeof cleanValue === "number") {
15100+
cleanValue = cleanValue.toString();
15101+
}
1509915102
if (cleanValue.indexOf(":") >= 0) {
1510015103
cleanValue = cleanValue.split(":")[0];
1510115104
}

clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
376376
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
377377
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
378378

379-
const sanitizeErrorCode = (rawValue: string): string => {
379+
const sanitizeErrorCode = (rawValue: string | number): string => {
380380
let cleanValue = rawValue;
381+
if (typeof cleanValue === "number") {
382+
cleanValue = cleanValue.toString();
383+
}
381384
if (cleanValue.indexOf(":") >= 0) {
382385
cleanValue = cleanValue.split(":")[0];
383386
}

clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9163,8 +9163,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
91639163
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
91649164
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
91659165

9166-
const sanitizeErrorCode = (rawValue: string): string => {
9166+
const sanitizeErrorCode = (rawValue: string | number): string => {
91679167
let cleanValue = rawValue;
9168+
if (typeof cleanValue === "number") {
9169+
cleanValue = cleanValue.toString();
9170+
}
91689171
if (cleanValue.indexOf(":") >= 0) {
91699172
cleanValue = cleanValue.split(":")[0];
91709173
}

clients/client-app-mesh/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7765,8 +7765,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
77657765
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
77667766
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
77677767

7768-
const sanitizeErrorCode = (rawValue: string): string => {
7768+
const sanitizeErrorCode = (rawValue: string | number): string => {
77697769
let cleanValue = rawValue;
7770+
if (typeof cleanValue === "number") {
7771+
cleanValue = cleanValue.toString();
7772+
}
77707773
if (cleanValue.indexOf(":") >= 0) {
77717774
cleanValue = cleanValue.split(":")[0];
77727775
}

clients/client-appconfig/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5279,8 +5279,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
52795279
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
52805280
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
52815281

5282-
const sanitizeErrorCode = (rawValue: string): string => {
5282+
const sanitizeErrorCode = (rawValue: string | number): string => {
52835283
let cleanValue = rawValue;
5284+
if (typeof cleanValue === "number") {
5285+
cleanValue = cleanValue.toString();
5286+
}
52845287
if (cleanValue.indexOf(":") >= 0) {
52855288
cleanValue = cleanValue.split(":")[0];
52865289
}

clients/client-appconfigdata/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
366366
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
367367
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
368368

369-
const sanitizeErrorCode = (rawValue: string): string => {
369+
const sanitizeErrorCode = (rawValue: string | number): string => {
370370
let cleanValue = rawValue;
371+
if (typeof cleanValue === "number") {
372+
cleanValue = cleanValue.toString();
373+
}
371374
if (cleanValue.indexOf(":") >= 0) {
372375
cleanValue = cleanValue.split(":")[0];
373376
}

clients/client-appflow/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5653,8 +5653,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
56535653
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
56545654
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
56555655

5656-
const sanitizeErrorCode = (rawValue: string): string => {
5656+
const sanitizeErrorCode = (rawValue: string | number): string => {
56575657
let cleanValue = rawValue;
5658+
if (typeof cleanValue === "number") {
5659+
cleanValue = cleanValue.toString();
5660+
}
56585661
if (cleanValue.indexOf(":") >= 0) {
56595662
cleanValue = cleanValue.split(":")[0];
56605663
}

clients/client-appintegrations/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,8 +1791,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
17911791
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
17921792
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
17931793

1794-
const sanitizeErrorCode = (rawValue: string): string => {
1794+
const sanitizeErrorCode = (rawValue: string | number): string => {
17951795
let cleanValue = rawValue;
1796+
if (typeof cleanValue === "number") {
1797+
cleanValue = cleanValue.toString();
1798+
}
17961799
if (cleanValue.indexOf(":") >= 0) {
17971800
cleanValue = cleanValue.split(":")[0];
17981801
}

clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,8 +1620,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
16201620
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
16211621
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
16221622

1623-
const sanitizeErrorCode = (rawValue: string): string => {
1623+
const sanitizeErrorCode = (rawValue: string | number): string => {
16241624
let cleanValue = rawValue;
1625+
if (typeof cleanValue === "number") {
1626+
cleanValue = cleanValue.toString();
1627+
}
16251628
if (cleanValue.indexOf(":") >= 0) {
16261629
cleanValue = cleanValue.split(":")[0];
16271630
}

clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3267,8 +3267,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
32673267
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
32683268
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
32693269

3270-
const sanitizeErrorCode = (rawValue: string): string => {
3270+
const sanitizeErrorCode = (rawValue: string | number): string => {
32713271
let cleanValue = rawValue;
3272+
if (typeof cleanValue === "number") {
3273+
cleanValue = cleanValue.toString();
3274+
}
32723275
if (cleanValue.indexOf(":") >= 0) {
32733276
cleanValue = cleanValue.split(":")[0];
32743277
}

clients/client-application-insights/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2946,8 +2946,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
29462946
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
29472947
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
29482948

2949-
const sanitizeErrorCode = (rawValue: string): string => {
2949+
const sanitizeErrorCode = (rawValue: string | number): string => {
29502950
let cleanValue = rawValue;
2951+
if (typeof cleanValue === "number") {
2952+
cleanValue = cleanValue.toString();
2953+
}
29512954
if (cleanValue.indexOf(":") >= 0) {
29522955
cleanValue = cleanValue.split(":")[0];
29532956
}

clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
757757
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
758758
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
759759

760-
const sanitizeErrorCode = (rawValue: string): string => {
760+
const sanitizeErrorCode = (rawValue: string | number): string => {
761761
let cleanValue = rawValue;
762+
if (typeof cleanValue === "number") {
763+
cleanValue = cleanValue.toString();
764+
}
762765
if (cleanValue.indexOf(":") >= 0) {
763766
cleanValue = cleanValue.split(":")[0];
764767
}

clients/client-apprunner/src/protocols/Aws_json1_0.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3587,8 +3587,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
35873587
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
35883588
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
35893589

3590-
const sanitizeErrorCode = (rawValue: string): string => {
3590+
const sanitizeErrorCode = (rawValue: string | number): string => {
35913591
let cleanValue = rawValue;
3592+
if (typeof cleanValue === "number") {
3593+
cleanValue = cleanValue.toString();
3594+
}
35923595
if (cleanValue.indexOf(":") >= 0) {
35933596
cleanValue = cleanValue.split(":")[0];
35943597
}

clients/client-appstream/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7516,8 +7516,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
75167516
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
75177517
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
75187518

7519-
const sanitizeErrorCode = (rawValue: string): string => {
7519+
const sanitizeErrorCode = (rawValue: string | number): string => {
75207520
let cleanValue = rawValue;
7521+
if (typeof cleanValue === "number") {
7522+
cleanValue = cleanValue.toString();
7523+
}
75217524
if (cleanValue.indexOf(":") >= 0) {
75227525
cleanValue = cleanValue.split(":")[0];
75237526
}

clients/client-appsync/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5651,8 +5651,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
56515651
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
56525652
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
56535653

5654-
const sanitizeErrorCode = (rawValue: string): string => {
5654+
const sanitizeErrorCode = (rawValue: string | number): string => {
56555655
let cleanValue = rawValue;
5656+
if (typeof cleanValue === "number") {
5657+
cleanValue = cleanValue.toString();
5658+
}
56565659
if (cleanValue.indexOf(":") >= 0) {
56575660
cleanValue = cleanValue.split(":")[0];
56585661
}

clients/client-athena/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3965,8 +3965,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
39653965
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
39663966
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
39673967

3968-
const sanitizeErrorCode = (rawValue: string): string => {
3968+
const sanitizeErrorCode = (rawValue: string | number): string => {
39693969
let cleanValue = rawValue;
3970+
if (typeof cleanValue === "number") {
3971+
cleanValue = cleanValue.toString();
3972+
}
39703973
if (cleanValue.indexOf(":") >= 0) {
39713974
cleanValue = cleanValue.split(":")[0];
39723975
}

clients/client-auditmanager/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7130,8 +7130,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
71307130
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
71317131
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
71327132

7133-
const sanitizeErrorCode = (rawValue: string): string => {
7133+
const sanitizeErrorCode = (rawValue: string | number): string => {
71347134
let cleanValue = rawValue;
7135+
if (typeof cleanValue === "number") {
7136+
cleanValue = cleanValue.toString();
7137+
}
71357138
if (cleanValue.indexOf(":") >= 0) {
71367139
cleanValue = cleanValue.split(":")[0];
71377140
}

clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
12941294
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
12951295
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
12961296

1297-
const sanitizeErrorCode = (rawValue: string): string => {
1297+
const sanitizeErrorCode = (rawValue: string | number): string => {
12981298
let cleanValue = rawValue;
1299+
if (typeof cleanValue === "number") {
1300+
cleanValue = cleanValue.toString();
1301+
}
12991302
if (cleanValue.indexOf(":") >= 0) {
13001303
cleanValue = cleanValue.split(":")[0];
13011304
}

clients/client-backup-gateway/src/protocols/Aws_json1_0.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,8 +1854,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
18541854
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
18551855
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
18561856

1857-
const sanitizeErrorCode = (rawValue: string): string => {
1857+
const sanitizeErrorCode = (rawValue: string | number): string => {
18581858
let cleanValue = rawValue;
1859+
if (typeof cleanValue === "number") {
1860+
cleanValue = cleanValue.toString();
1861+
}
18591862
if (cleanValue.indexOf(":") >= 0) {
18601863
cleanValue = cleanValue.split(":")[0];
18611864
}

clients/client-backup/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7997,8 +7997,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
79977997
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
79987998
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
79997999

8000-
const sanitizeErrorCode = (rawValue: string): string => {
8000+
const sanitizeErrorCode = (rawValue: string | number): string => {
80018001
let cleanValue = rawValue;
8002+
if (typeof cleanValue === "number") {
8003+
cleanValue = cleanValue.toString();
8004+
}
80028005
if (cleanValue.indexOf(":") >= 0) {
80038006
cleanValue = cleanValue.split(":")[0];
80048007
}

clients/client-batch/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3742,8 +3742,11 @@ const parseBody = (streamBody: any, context: __SerdeContext): any =>
37423742
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
37433743
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
37443744

3745-
const sanitizeErrorCode = (rawValue: string): string => {
3745+
const sanitizeErrorCode = (rawValue: string | number): string => {
37463746
let cleanValue = rawValue;
3747+
if (typeof cleanValue === "number") {
3748+
cleanValue = cleanValue.toString();
3749+
}
37473750
if (cleanValue.indexOf(":") >= 0) {
37483751
cleanValue = cleanValue.split(":")[0];
37493752
}

0 commit comments

Comments
 (0)