@aws-sdk/client-amplifybackend 3.118.1 → 3.128.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,8 +35,7 @@ const serializeAws_restJson1CloneBackendCommand = async (input, context) => {
35
35
  }
36
36
  let body;
37
37
  body = JSON.stringify({
38
- ...(input.TargetEnvironmentName !== undefined &&
39
- input.TargetEnvironmentName !== null && { targetEnvironmentName: input.TargetEnvironmentName }),
38
+ ...(input.TargetEnvironmentName != null && { targetEnvironmentName: input.TargetEnvironmentName }),
40
39
  });
41
40
  return new protocol_http_1.HttpRequest({
42
41
  protocol,
@@ -57,15 +56,13 @@ const serializeAws_restJson1CreateBackendCommand = async (input, context) => {
57
56
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/backend";
58
57
  let body;
59
58
  body = JSON.stringify({
60
- ...(input.AppId !== undefined && input.AppId !== null && { appId: input.AppId }),
61
- ...(input.AppName !== undefined && input.AppName !== null && { appName: input.AppName }),
62
- ...(input.BackendEnvironmentName !== undefined &&
63
- input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }),
64
- ...(input.ResourceConfig !== undefined &&
65
- input.ResourceConfig !== null && {
59
+ ...(input.AppId != null && { appId: input.AppId }),
60
+ ...(input.AppName != null && { appName: input.AppName }),
61
+ ...(input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName }),
62
+ ...(input.ResourceConfig != null && {
66
63
  resourceConfig: serializeAws_restJson1ResourceConfig(input.ResourceConfig, context),
67
64
  }),
68
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
65
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
69
66
  });
70
67
  return new protocol_http_1.HttpRequest({
71
68
  protocol,
@@ -96,13 +93,11 @@ const serializeAws_restJson1CreateBackendAPICommand = async (input, context) =>
96
93
  }
97
94
  let body;
98
95
  body = JSON.stringify({
99
- ...(input.BackendEnvironmentName !== undefined &&
100
- input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }),
101
- ...(input.ResourceConfig !== undefined &&
102
- input.ResourceConfig !== null && {
96
+ ...(input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName }),
97
+ ...(input.ResourceConfig != null && {
103
98
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
104
99
  }),
105
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
100
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
106
101
  });
107
102
  return new protocol_http_1.HttpRequest({
108
103
  protocol,
@@ -133,13 +128,11 @@ const serializeAws_restJson1CreateBackendAuthCommand = async (input, context) =>
133
128
  }
134
129
  let body;
135
130
  body = JSON.stringify({
136
- ...(input.BackendEnvironmentName !== undefined &&
137
- input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }),
138
- ...(input.ResourceConfig !== undefined &&
139
- input.ResourceConfig !== null && {
131
+ ...(input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName }),
132
+ ...(input.ResourceConfig != null && {
140
133
  resourceConfig: serializeAws_restJson1CreateBackendAuthResourceConfig(input.ResourceConfig, context),
141
134
  }),
142
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
135
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
143
136
  });
144
137
  return new protocol_http_1.HttpRequest({
145
138
  protocol,
@@ -170,8 +163,7 @@ const serializeAws_restJson1CreateBackendConfigCommand = async (input, context)
170
163
  }
171
164
  let body;
172
165
  body = JSON.stringify({
173
- ...(input.BackendManagerAppId !== undefined &&
174
- input.BackendManagerAppId !== null && { backendManagerAppId: input.BackendManagerAppId }),
166
+ ...(input.BackendManagerAppId != null && { backendManagerAppId: input.BackendManagerAppId }),
175
167
  });
176
168
  return new protocol_http_1.HttpRequest({
177
169
  protocol,
@@ -202,13 +194,11 @@ const serializeAws_restJson1CreateBackendStorageCommand = async (input, context)
202
194
  }
203
195
  let body;
204
196
  body = JSON.stringify({
205
- ...(input.BackendEnvironmentName !== undefined &&
206
- input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }),
207
- ...(input.ResourceConfig !== undefined &&
208
- input.ResourceConfig !== null && {
197
+ ...(input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName }),
198
+ ...(input.ResourceConfig != null && {
209
199
  resourceConfig: serializeAws_restJson1CreateBackendStorageResourceConfig(input.ResourceConfig, context),
210
200
  }),
211
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
201
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
212
202
  });
213
203
  return new protocol_http_1.HttpRequest({
214
204
  protocol,
@@ -313,11 +303,10 @@ const serializeAws_restJson1DeleteBackendAPICommand = async (input, context) =>
313
303
  }
314
304
  let body;
315
305
  body = JSON.stringify({
316
- ...(input.ResourceConfig !== undefined &&
317
- input.ResourceConfig !== null && {
306
+ ...(input.ResourceConfig != null && {
318
307
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
319
308
  }),
320
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
309
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
321
310
  });
322
311
  return new protocol_http_1.HttpRequest({
323
312
  protocol,
@@ -359,7 +348,7 @@ const serializeAws_restJson1DeleteBackendAuthCommand = async (input, context) =>
359
348
  }
360
349
  let body;
361
350
  body = JSON.stringify({
362
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
351
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
363
352
  });
364
353
  return new protocol_http_1.HttpRequest({
365
354
  protocol,
@@ -401,8 +390,8 @@ const serializeAws_restJson1DeleteBackendStorageCommand = async (input, context)
401
390
  }
402
391
  let body;
403
392
  body = JSON.stringify({
404
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
405
- ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
393
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
394
+ ...(input.ServiceName != null && { serviceName: input.ServiceName }),
406
395
  });
407
396
  return new protocol_http_1.HttpRequest({
408
397
  protocol,
@@ -481,7 +470,7 @@ const serializeAws_restJson1GenerateBackendAPIModelsCommand = async (input, cont
481
470
  }
482
471
  let body;
483
472
  body = JSON.stringify({
484
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
473
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
485
474
  });
486
475
  return new protocol_http_1.HttpRequest({
487
476
  protocol,
@@ -512,8 +501,7 @@ const serializeAws_restJson1GetBackendCommand = async (input, context) => {
512
501
  }
513
502
  let body;
514
503
  body = JSON.stringify({
515
- ...(input.BackendEnvironmentName !== undefined &&
516
- input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }),
504
+ ...(input.BackendEnvironmentName != null && { backendEnvironmentName: input.BackendEnvironmentName }),
517
505
  });
518
506
  return new protocol_http_1.HttpRequest({
519
507
  protocol,
@@ -555,11 +543,10 @@ const serializeAws_restJson1GetBackendAPICommand = async (input, context) => {
555
543
  }
556
544
  let body;
557
545
  body = JSON.stringify({
558
- ...(input.ResourceConfig !== undefined &&
559
- input.ResourceConfig !== null && {
546
+ ...(input.ResourceConfig != null && {
560
547
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
561
548
  }),
562
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
549
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
563
550
  });
564
551
  return new protocol_http_1.HttpRequest({
565
552
  protocol,
@@ -601,7 +588,7 @@ const serializeAws_restJson1GetBackendAPIModelsCommand = async (input, context)
601
588
  }
602
589
  let body;
603
590
  body = JSON.stringify({
604
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
591
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
605
592
  });
606
593
  return new protocol_http_1.HttpRequest({
607
594
  protocol,
@@ -643,7 +630,7 @@ const serializeAws_restJson1GetBackendAuthCommand = async (input, context) => {
643
630
  }
644
631
  let body;
645
632
  body = JSON.stringify({
646
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
633
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
647
634
  });
648
635
  return new protocol_http_1.HttpRequest({
649
636
  protocol,
@@ -732,7 +719,7 @@ const serializeAws_restJson1GetBackendStorageCommand = async (input, context) =>
732
719
  }
733
720
  let body;
734
721
  body = JSON.stringify({
735
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
722
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
736
723
  });
737
724
  return new protocol_http_1.HttpRequest({
738
725
  protocol,
@@ -810,12 +797,10 @@ const serializeAws_restJson1ImportBackendAuthCommand = async (input, context) =>
810
797
  }
811
798
  let body;
812
799
  body = JSON.stringify({
813
- ...(input.IdentityPoolId !== undefined &&
814
- input.IdentityPoolId !== null && { identityPoolId: input.IdentityPoolId }),
815
- ...(input.NativeClientId !== undefined &&
816
- input.NativeClientId !== null && { nativeClientId: input.NativeClientId }),
817
- ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { userPoolId: input.UserPoolId }),
818
- ...(input.WebClientId !== undefined && input.WebClientId !== null && { webClientId: input.WebClientId }),
800
+ ...(input.IdentityPoolId != null && { identityPoolId: input.IdentityPoolId }),
801
+ ...(input.NativeClientId != null && { nativeClientId: input.NativeClientId }),
802
+ ...(input.UserPoolId != null && { userPoolId: input.UserPoolId }),
803
+ ...(input.WebClientId != null && { webClientId: input.WebClientId }),
819
804
  });
820
805
  return new protocol_http_1.HttpRequest({
821
806
  protocol,
@@ -857,8 +842,8 @@ const serializeAws_restJson1ImportBackendStorageCommand = async (input, context)
857
842
  }
858
843
  let body;
859
844
  body = JSON.stringify({
860
- ...(input.BucketName !== undefined && input.BucketName !== null && { bucketName: input.BucketName }),
861
- ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
845
+ ...(input.BucketName != null && { bucketName: input.BucketName }),
846
+ ...(input.ServiceName != null && { serviceName: input.ServiceName }),
862
847
  });
863
848
  return new protocol_http_1.HttpRequest({
864
849
  protocol,
@@ -900,11 +885,11 @@ const serializeAws_restJson1ListBackendJobsCommand = async (input, context) => {
900
885
  }
901
886
  let body;
902
887
  body = JSON.stringify({
903
- ...(input.JobId !== undefined && input.JobId !== null && { jobId: input.JobId }),
904
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { maxResults: input.MaxResults }),
905
- ...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }),
906
- ...(input.Operation !== undefined && input.Operation !== null && { operation: input.Operation }),
907
- ...(input.Status !== undefined && input.Status !== null && { status: input.Status }),
888
+ ...(input.JobId != null && { jobId: input.JobId }),
889
+ ...(input.MaxResults != null && { maxResults: input.MaxResults }),
890
+ ...(input.NextToken != null && { nextToken: input.NextToken }),
891
+ ...(input.Operation != null && { operation: input.Operation }),
892
+ ...(input.Status != null && { status: input.Status }),
908
893
  });
909
894
  return new protocol_http_1.HttpRequest({
910
895
  protocol,
@@ -925,7 +910,7 @@ const serializeAws_restJson1ListS3BucketsCommand = async (input, context) => {
925
910
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/s3Buckets";
926
911
  let body;
927
912
  body = JSON.stringify({
928
- ...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }),
913
+ ...(input.NextToken != null && { nextToken: input.NextToken }),
929
914
  });
930
915
  return new protocol_http_1.HttpRequest({
931
916
  protocol,
@@ -956,8 +941,7 @@ const serializeAws_restJson1RemoveAllBackendsCommand = async (input, context) =>
956
941
  }
957
942
  let body;
958
943
  body = JSON.stringify({
959
- ...(input.CleanAmplifyApp !== undefined &&
960
- input.CleanAmplifyApp !== null && { cleanAmplifyApp: input.CleanAmplifyApp }),
944
+ ...(input.CleanAmplifyApp != null && { cleanAmplifyApp: input.CleanAmplifyApp }),
961
945
  });
962
946
  return new protocol_http_1.HttpRequest({
963
947
  protocol,
@@ -1025,11 +1009,10 @@ const serializeAws_restJson1UpdateBackendAPICommand = async (input, context) =>
1025
1009
  }
1026
1010
  let body;
1027
1011
  body = JSON.stringify({
1028
- ...(input.ResourceConfig !== undefined &&
1029
- input.ResourceConfig !== null && {
1012
+ ...(input.ResourceConfig != null && {
1030
1013
  resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context),
1031
1014
  }),
1032
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
1015
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
1033
1016
  });
1034
1017
  return new protocol_http_1.HttpRequest({
1035
1018
  protocol,
@@ -1071,11 +1054,10 @@ const serializeAws_restJson1UpdateBackendAuthCommand = async (input, context) =>
1071
1054
  }
1072
1055
  let body;
1073
1056
  body = JSON.stringify({
1074
- ...(input.ResourceConfig !== undefined &&
1075
- input.ResourceConfig !== null && {
1057
+ ...(input.ResourceConfig != null && {
1076
1058
  resourceConfig: serializeAws_restJson1UpdateBackendAuthResourceConfig(input.ResourceConfig, context),
1077
1059
  }),
1078
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
1060
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
1079
1061
  });
1080
1062
  return new protocol_http_1.HttpRequest({
1081
1063
  protocol,
@@ -1106,8 +1088,7 @@ const serializeAws_restJson1UpdateBackendConfigCommand = async (input, context)
1106
1088
  }
1107
1089
  let body;
1108
1090
  body = JSON.stringify({
1109
- ...(input.LoginAuthConfig !== undefined &&
1110
- input.LoginAuthConfig !== null && {
1091
+ ...(input.LoginAuthConfig != null && {
1111
1092
  loginAuthConfig: serializeAws_restJson1LoginAuthConfigReqObj(input.LoginAuthConfig, context),
1112
1093
  }),
1113
1094
  });
@@ -1161,8 +1142,8 @@ const serializeAws_restJson1UpdateBackendJobCommand = async (input, context) =>
1161
1142
  }
1162
1143
  let body;
1163
1144
  body = JSON.stringify({
1164
- ...(input.Operation !== undefined && input.Operation !== null && { operation: input.Operation }),
1165
- ...(input.Status !== undefined && input.Status !== null && { status: input.Status }),
1145
+ ...(input.Operation != null && { operation: input.Operation }),
1146
+ ...(input.Status != null && { status: input.Status }),
1166
1147
  });
1167
1148
  return new protocol_http_1.HttpRequest({
1168
1149
  protocol,
@@ -1204,11 +1185,10 @@ const serializeAws_restJson1UpdateBackendStorageCommand = async (input, context)
1204
1185
  }
1205
1186
  let body;
1206
1187
  body = JSON.stringify({
1207
- ...(input.ResourceConfig !== undefined &&
1208
- input.ResourceConfig !== null && {
1188
+ ...(input.ResourceConfig != null && {
1209
1189
  resourceConfig: serializeAws_restJson1UpdateBackendStorageResourceConfig(input.ResourceConfig, context),
1210
1190
  }),
1211
- ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }),
1191
+ ...(input.ResourceName != null && { resourceName: input.ResourceName }),
1212
1192
  });
1213
1193
  return new protocol_http_1.HttpRequest({
1214
1194
  protocol,
@@ -1262,8 +1242,7 @@ const deserializeAws_restJson1CloneBackendCommandError = async (output, context)
1262
1242
  body: await parseBody(output.body, context),
1263
1243
  };
1264
1244
  let response;
1265
- let errorCode = "UnknownError";
1266
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1245
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1267
1246
  switch (errorCode) {
1268
1247
  case "BadRequestException":
1269
1248
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1279,10 +1258,12 @@ const deserializeAws_restJson1CloneBackendCommandError = async (output, context)
1279
1258
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1280
1259
  default:
1281
1260
  const parsedBody = parsedOutput.body;
1261
+ const $metadata = deserializeMetadata(output);
1262
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1282
1263
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1283
- name: parsedBody.code || parsedBody.Code || errorCode,
1264
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1284
1265
  $fault: "client",
1285
- $metadata: deserializeMetadata(output),
1266
+ $metadata,
1286
1267
  });
1287
1268
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1288
1269
  }
@@ -1328,8 +1309,7 @@ const deserializeAws_restJson1CreateBackendCommandError = async (output, context
1328
1309
  body: await parseBody(output.body, context),
1329
1310
  };
1330
1311
  let response;
1331
- let errorCode = "UnknownError";
1332
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1312
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1333
1313
  switch (errorCode) {
1334
1314
  case "BadRequestException":
1335
1315
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1345,10 +1325,12 @@ const deserializeAws_restJson1CreateBackendCommandError = async (output, context
1345
1325
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1346
1326
  default:
1347
1327
  const parsedBody = parsedOutput.body;
1328
+ const $metadata = deserializeMetadata(output);
1329
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1348
1330
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1349
- name: parsedBody.code || parsedBody.Code || errorCode,
1331
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1350
1332
  $fault: "client",
1351
- $metadata: deserializeMetadata(output),
1333
+ $metadata,
1352
1334
  });
1353
1335
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1354
1336
  }
@@ -1394,8 +1376,7 @@ const deserializeAws_restJson1CreateBackendAPICommandError = async (output, cont
1394
1376
  body: await parseBody(output.body, context),
1395
1377
  };
1396
1378
  let response;
1397
- let errorCode = "UnknownError";
1398
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1379
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1399
1380
  switch (errorCode) {
1400
1381
  case "BadRequestException":
1401
1382
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1411,10 +1392,12 @@ const deserializeAws_restJson1CreateBackendAPICommandError = async (output, cont
1411
1392
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1412
1393
  default:
1413
1394
  const parsedBody = parsedOutput.body;
1395
+ const $metadata = deserializeMetadata(output);
1396
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1414
1397
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1415
- name: parsedBody.code || parsedBody.Code || errorCode,
1398
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1416
1399
  $fault: "client",
1417
- $metadata: deserializeMetadata(output),
1400
+ $metadata,
1418
1401
  });
1419
1402
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1420
1403
  }
@@ -1460,8 +1443,7 @@ const deserializeAws_restJson1CreateBackendAuthCommandError = async (output, con
1460
1443
  body: await parseBody(output.body, context),
1461
1444
  };
1462
1445
  let response;
1463
- let errorCode = "UnknownError";
1464
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1446
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1465
1447
  switch (errorCode) {
1466
1448
  case "BadRequestException":
1467
1449
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1477,10 +1459,12 @@ const deserializeAws_restJson1CreateBackendAuthCommandError = async (output, con
1477
1459
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1478
1460
  default:
1479
1461
  const parsedBody = parsedOutput.body;
1462
+ const $metadata = deserializeMetadata(output);
1463
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1480
1464
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1481
- name: parsedBody.code || parsedBody.Code || errorCode,
1465
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1482
1466
  $fault: "client",
1483
- $metadata: deserializeMetadata(output),
1467
+ $metadata,
1484
1468
  });
1485
1469
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1486
1470
  }
@@ -1518,8 +1502,7 @@ const deserializeAws_restJson1CreateBackendConfigCommandError = async (output, c
1518
1502
  body: await parseBody(output.body, context),
1519
1503
  };
1520
1504
  let response;
1521
- let errorCode = "UnknownError";
1522
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1505
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1523
1506
  switch (errorCode) {
1524
1507
  case "BadRequestException":
1525
1508
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1535,10 +1518,12 @@ const deserializeAws_restJson1CreateBackendConfigCommandError = async (output, c
1535
1518
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1536
1519
  default:
1537
1520
  const parsedBody = parsedOutput.body;
1521
+ const $metadata = deserializeMetadata(output);
1522
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1538
1523
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1539
- name: parsedBody.code || parsedBody.Code || errorCode,
1524
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1540
1525
  $fault: "client",
1541
- $metadata: deserializeMetadata(output),
1526
+ $metadata,
1542
1527
  });
1543
1528
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1544
1529
  }
@@ -1576,8 +1561,7 @@ const deserializeAws_restJson1CreateBackendStorageCommandError = async (output,
1576
1561
  body: await parseBody(output.body, context),
1577
1562
  };
1578
1563
  let response;
1579
- let errorCode = "UnknownError";
1580
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1564
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1581
1565
  switch (errorCode) {
1582
1566
  case "BadRequestException":
1583
1567
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1593,10 +1577,12 @@ const deserializeAws_restJson1CreateBackendStorageCommandError = async (output,
1593
1577
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1594
1578
  default:
1595
1579
  const parsedBody = parsedOutput.body;
1580
+ const $metadata = deserializeMetadata(output);
1581
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1596
1582
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1597
- name: parsedBody.code || parsedBody.Code || errorCode,
1583
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1598
1584
  $fault: "client",
1599
- $metadata: deserializeMetadata(output),
1585
+ $metadata,
1600
1586
  });
1601
1587
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1602
1588
  }
@@ -1634,8 +1620,7 @@ const deserializeAws_restJson1CreateTokenCommandError = async (output, context)
1634
1620
  body: await parseBody(output.body, context),
1635
1621
  };
1636
1622
  let response;
1637
- let errorCode = "UnknownError";
1638
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1623
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1639
1624
  switch (errorCode) {
1640
1625
  case "BadRequestException":
1641
1626
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1651,10 +1636,12 @@ const deserializeAws_restJson1CreateTokenCommandError = async (output, context)
1651
1636
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1652
1637
  default:
1653
1638
  const parsedBody = parsedOutput.body;
1639
+ const $metadata = deserializeMetadata(output);
1640
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1654
1641
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1655
- name: parsedBody.code || parsedBody.Code || errorCode,
1642
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1656
1643
  $fault: "client",
1657
- $metadata: deserializeMetadata(output),
1644
+ $metadata,
1658
1645
  });
1659
1646
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1660
1647
  }
@@ -1700,8 +1687,7 @@ const deserializeAws_restJson1DeleteBackendCommandError = async (output, context
1700
1687
  body: await parseBody(output.body, context),
1701
1688
  };
1702
1689
  let response;
1703
- let errorCode = "UnknownError";
1704
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1690
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1705
1691
  switch (errorCode) {
1706
1692
  case "BadRequestException":
1707
1693
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1717,10 +1703,12 @@ const deserializeAws_restJson1DeleteBackendCommandError = async (output, context
1717
1703
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1718
1704
  default:
1719
1705
  const parsedBody = parsedOutput.body;
1706
+ const $metadata = deserializeMetadata(output);
1707
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1720
1708
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1721
- name: parsedBody.code || parsedBody.Code || errorCode,
1709
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1722
1710
  $fault: "client",
1723
- $metadata: deserializeMetadata(output),
1711
+ $metadata,
1724
1712
  });
1725
1713
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1726
1714
  }
@@ -1766,8 +1754,7 @@ const deserializeAws_restJson1DeleteBackendAPICommandError = async (output, cont
1766
1754
  body: await parseBody(output.body, context),
1767
1755
  };
1768
1756
  let response;
1769
- let errorCode = "UnknownError";
1770
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1757
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1771
1758
  switch (errorCode) {
1772
1759
  case "BadRequestException":
1773
1760
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1783,10 +1770,12 @@ const deserializeAws_restJson1DeleteBackendAPICommandError = async (output, cont
1783
1770
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1784
1771
  default:
1785
1772
  const parsedBody = parsedOutput.body;
1773
+ const $metadata = deserializeMetadata(output);
1774
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1786
1775
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1787
- name: parsedBody.code || parsedBody.Code || errorCode,
1776
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1788
1777
  $fault: "client",
1789
- $metadata: deserializeMetadata(output),
1778
+ $metadata,
1790
1779
  });
1791
1780
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1792
1781
  }
@@ -1832,8 +1821,7 @@ const deserializeAws_restJson1DeleteBackendAuthCommandError = async (output, con
1832
1821
  body: await parseBody(output.body, context),
1833
1822
  };
1834
1823
  let response;
1835
- let errorCode = "UnknownError";
1836
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1824
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1837
1825
  switch (errorCode) {
1838
1826
  case "BadRequestException":
1839
1827
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1849,10 +1837,12 @@ const deserializeAws_restJson1DeleteBackendAuthCommandError = async (output, con
1849
1837
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1850
1838
  default:
1851
1839
  const parsedBody = parsedOutput.body;
1840
+ const $metadata = deserializeMetadata(output);
1841
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1852
1842
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1853
- name: parsedBody.code || parsedBody.Code || errorCode,
1843
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1854
1844
  $fault: "client",
1855
- $metadata: deserializeMetadata(output),
1845
+ $metadata,
1856
1846
  });
1857
1847
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1858
1848
  }
@@ -1890,8 +1880,7 @@ const deserializeAws_restJson1DeleteBackendStorageCommandError = async (output,
1890
1880
  body: await parseBody(output.body, context),
1891
1881
  };
1892
1882
  let response;
1893
- let errorCode = "UnknownError";
1894
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1883
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1895
1884
  switch (errorCode) {
1896
1885
  case "BadRequestException":
1897
1886
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1907,10 +1896,12 @@ const deserializeAws_restJson1DeleteBackendStorageCommandError = async (output,
1907
1896
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1908
1897
  default:
1909
1898
  const parsedBody = parsedOutput.body;
1899
+ const $metadata = deserializeMetadata(output);
1900
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1910
1901
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1911
- name: parsedBody.code || parsedBody.Code || errorCode,
1902
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1912
1903
  $fault: "client",
1913
- $metadata: deserializeMetadata(output),
1904
+ $metadata,
1914
1905
  });
1915
1906
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1916
1907
  }
@@ -1936,8 +1927,7 @@ const deserializeAws_restJson1DeleteTokenCommandError = async (output, context)
1936
1927
  body: await parseBody(output.body, context),
1937
1928
  };
1938
1929
  let response;
1939
- let errorCode = "UnknownError";
1940
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1930
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1941
1931
  switch (errorCode) {
1942
1932
  case "BadRequestException":
1943
1933
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -1953,10 +1943,12 @@ const deserializeAws_restJson1DeleteTokenCommandError = async (output, context)
1953
1943
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1954
1944
  default:
1955
1945
  const parsedBody = parsedOutput.body;
1946
+ const $metadata = deserializeMetadata(output);
1947
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1956
1948
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
1957
- name: parsedBody.code || parsedBody.Code || errorCode,
1949
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1958
1950
  $fault: "client",
1959
- $metadata: deserializeMetadata(output),
1951
+ $metadata,
1960
1952
  });
1961
1953
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1962
1954
  }
@@ -2002,8 +1994,7 @@ const deserializeAws_restJson1GenerateBackendAPIModelsCommandError = async (outp
2002
1994
  body: await parseBody(output.body, context),
2003
1995
  };
2004
1996
  let response;
2005
- let errorCode = "UnknownError";
2006
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1997
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2007
1998
  switch (errorCode) {
2008
1999
  case "BadRequestException":
2009
2000
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2019,10 +2010,12 @@ const deserializeAws_restJson1GenerateBackendAPIModelsCommandError = async (outp
2019
2010
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2020
2011
  default:
2021
2012
  const parsedBody = parsedOutput.body;
2013
+ const $metadata = deserializeMetadata(output);
2014
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2022
2015
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2023
- name: parsedBody.code || parsedBody.Code || errorCode,
2016
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2024
2017
  $fault: "client",
2025
- $metadata: deserializeMetadata(output),
2018
+ $metadata,
2026
2019
  });
2027
2020
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2028
2021
  }
@@ -2072,8 +2065,7 @@ const deserializeAws_restJson1GetBackendCommandError = async (output, context) =
2072
2065
  body: await parseBody(output.body, context),
2073
2066
  };
2074
2067
  let response;
2075
- let errorCode = "UnknownError";
2076
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2068
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2077
2069
  switch (errorCode) {
2078
2070
  case "BadRequestException":
2079
2071
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2089,10 +2081,12 @@ const deserializeAws_restJson1GetBackendCommandError = async (output, context) =
2089
2081
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2090
2082
  default:
2091
2083
  const parsedBody = parsedOutput.body;
2084
+ const $metadata = deserializeMetadata(output);
2085
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2092
2086
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2093
- name: parsedBody.code || parsedBody.Code || errorCode,
2087
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2094
2088
  $fault: "client",
2095
- $metadata: deserializeMetadata(output),
2089
+ $metadata,
2096
2090
  });
2097
2091
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2098
2092
  }
@@ -2134,8 +2128,7 @@ const deserializeAws_restJson1GetBackendAPICommandError = async (output, context
2134
2128
  body: await parseBody(output.body, context),
2135
2129
  };
2136
2130
  let response;
2137
- let errorCode = "UnknownError";
2138
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2131
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2139
2132
  switch (errorCode) {
2140
2133
  case "BadRequestException":
2141
2134
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2151,10 +2144,12 @@ const deserializeAws_restJson1GetBackendAPICommandError = async (output, context
2151
2144
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2152
2145
  default:
2153
2146
  const parsedBody = parsedOutput.body;
2147
+ const $metadata = deserializeMetadata(output);
2148
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2154
2149
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2155
- name: parsedBody.code || parsedBody.Code || errorCode,
2150
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2156
2151
  $fault: "client",
2157
- $metadata: deserializeMetadata(output),
2152
+ $metadata,
2158
2153
  });
2159
2154
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2160
2155
  }
@@ -2184,8 +2179,7 @@ const deserializeAws_restJson1GetBackendAPIModelsCommandError = async (output, c
2184
2179
  body: await parseBody(output.body, context),
2185
2180
  };
2186
2181
  let response;
2187
- let errorCode = "UnknownError";
2188
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2182
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2189
2183
  switch (errorCode) {
2190
2184
  case "BadRequestException":
2191
2185
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2201,10 +2195,12 @@ const deserializeAws_restJson1GetBackendAPIModelsCommandError = async (output, c
2201
2195
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2202
2196
  default:
2203
2197
  const parsedBody = parsedOutput.body;
2198
+ const $metadata = deserializeMetadata(output);
2199
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2204
2200
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2205
- name: parsedBody.code || parsedBody.Code || errorCode,
2201
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2206
2202
  $fault: "client",
2207
- $metadata: deserializeMetadata(output),
2203
+ $metadata,
2208
2204
  });
2209
2205
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2210
2206
  }
@@ -2246,8 +2242,7 @@ const deserializeAws_restJson1GetBackendAuthCommandError = async (output, contex
2246
2242
  body: await parseBody(output.body, context),
2247
2243
  };
2248
2244
  let response;
2249
- let errorCode = "UnknownError";
2250
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2245
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2251
2246
  switch (errorCode) {
2252
2247
  case "BadRequestException":
2253
2248
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2263,10 +2258,12 @@ const deserializeAws_restJson1GetBackendAuthCommandError = async (output, contex
2263
2258
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2264
2259
  default:
2265
2260
  const parsedBody = parsedOutput.body;
2261
+ const $metadata = deserializeMetadata(output);
2262
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2266
2263
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2267
- name: parsedBody.code || parsedBody.Code || errorCode,
2264
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2268
2265
  $fault: "client",
2269
- $metadata: deserializeMetadata(output),
2266
+ $metadata,
2270
2267
  });
2271
2268
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2272
2269
  }
@@ -2320,8 +2317,7 @@ const deserializeAws_restJson1GetBackendJobCommandError = async (output, context
2320
2317
  body: await parseBody(output.body, context),
2321
2318
  };
2322
2319
  let response;
2323
- let errorCode = "UnknownError";
2324
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2320
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2325
2321
  switch (errorCode) {
2326
2322
  case "BadRequestException":
2327
2323
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2337,10 +2333,12 @@ const deserializeAws_restJson1GetBackendJobCommandError = async (output, context
2337
2333
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2338
2334
  default:
2339
2335
  const parsedBody = parsedOutput.body;
2336
+ const $metadata = deserializeMetadata(output);
2337
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2340
2338
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2341
- name: parsedBody.code || parsedBody.Code || errorCode,
2339
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2342
2340
  $fault: "client",
2343
- $metadata: deserializeMetadata(output),
2341
+ $metadata,
2344
2342
  });
2345
2343
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2346
2344
  }
@@ -2378,8 +2376,7 @@ const deserializeAws_restJson1GetBackendStorageCommandError = async (output, con
2378
2376
  body: await parseBody(output.body, context),
2379
2377
  };
2380
2378
  let response;
2381
- let errorCode = "UnknownError";
2382
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2379
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2383
2380
  switch (errorCode) {
2384
2381
  case "BadRequestException":
2385
2382
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2395,10 +2392,12 @@ const deserializeAws_restJson1GetBackendStorageCommandError = async (output, con
2395
2392
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2396
2393
  default:
2397
2394
  const parsedBody = parsedOutput.body;
2395
+ const $metadata = deserializeMetadata(output);
2396
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2398
2397
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2399
- name: parsedBody.code || parsedBody.Code || errorCode,
2398
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2400
2399
  $fault: "client",
2401
- $metadata: deserializeMetadata(output),
2400
+ $metadata,
2402
2401
  });
2403
2402
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2404
2403
  }
@@ -2436,8 +2435,7 @@ const deserializeAws_restJson1GetTokenCommandError = async (output, context) =>
2436
2435
  body: await parseBody(output.body, context),
2437
2436
  };
2438
2437
  let response;
2439
- let errorCode = "UnknownError";
2440
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2438
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2441
2439
  switch (errorCode) {
2442
2440
  case "BadRequestException":
2443
2441
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2453,10 +2451,12 @@ const deserializeAws_restJson1GetTokenCommandError = async (output, context) =>
2453
2451
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2454
2452
  default:
2455
2453
  const parsedBody = parsedOutput.body;
2454
+ const $metadata = deserializeMetadata(output);
2455
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2456
2456
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2457
- name: parsedBody.code || parsedBody.Code || errorCode,
2457
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2458
2458
  $fault: "client",
2459
- $metadata: deserializeMetadata(output),
2459
+ $metadata,
2460
2460
  });
2461
2461
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2462
2462
  }
@@ -2502,8 +2502,7 @@ const deserializeAws_restJson1ImportBackendAuthCommandError = async (output, con
2502
2502
  body: await parseBody(output.body, context),
2503
2503
  };
2504
2504
  let response;
2505
- let errorCode = "UnknownError";
2506
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2505
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2507
2506
  switch (errorCode) {
2508
2507
  case "BadRequestException":
2509
2508
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2519,10 +2518,12 @@ const deserializeAws_restJson1ImportBackendAuthCommandError = async (output, con
2519
2518
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2520
2519
  default:
2521
2520
  const parsedBody = parsedOutput.body;
2521
+ const $metadata = deserializeMetadata(output);
2522
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2522
2523
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2523
- name: parsedBody.code || parsedBody.Code || errorCode,
2524
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2524
2525
  $fault: "client",
2525
- $metadata: deserializeMetadata(output),
2526
+ $metadata,
2526
2527
  });
2527
2528
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2528
2529
  }
@@ -2560,8 +2561,7 @@ const deserializeAws_restJson1ImportBackendStorageCommandError = async (output,
2560
2561
  body: await parseBody(output.body, context),
2561
2562
  };
2562
2563
  let response;
2563
- let errorCode = "UnknownError";
2564
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2564
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2565
2565
  switch (errorCode) {
2566
2566
  case "BadRequestException":
2567
2567
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2577,10 +2577,12 @@ const deserializeAws_restJson1ImportBackendStorageCommandError = async (output,
2577
2577
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2578
2578
  default:
2579
2579
  const parsedBody = parsedOutput.body;
2580
+ const $metadata = deserializeMetadata(output);
2581
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2580
2582
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2581
- name: parsedBody.code || parsedBody.Code || errorCode,
2583
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2582
2584
  $fault: "client",
2583
- $metadata: deserializeMetadata(output),
2585
+ $metadata,
2584
2586
  });
2585
2587
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2586
2588
  }
@@ -2610,8 +2612,7 @@ const deserializeAws_restJson1ListBackendJobsCommandError = async (output, conte
2610
2612
  body: await parseBody(output.body, context),
2611
2613
  };
2612
2614
  let response;
2613
- let errorCode = "UnknownError";
2614
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2615
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2615
2616
  switch (errorCode) {
2616
2617
  case "BadRequestException":
2617
2618
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2627,10 +2628,12 @@ const deserializeAws_restJson1ListBackendJobsCommandError = async (output, conte
2627
2628
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2628
2629
  default:
2629
2630
  const parsedBody = parsedOutput.body;
2631
+ const $metadata = deserializeMetadata(output);
2632
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2630
2633
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2631
- name: parsedBody.code || parsedBody.Code || errorCode,
2634
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2632
2635
  $fault: "client",
2633
- $metadata: deserializeMetadata(output),
2636
+ $metadata,
2634
2637
  });
2635
2638
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2636
2639
  }
@@ -2660,8 +2663,7 @@ const deserializeAws_restJson1ListS3BucketsCommandError = async (output, context
2660
2663
  body: await parseBody(output.body, context),
2661
2664
  };
2662
2665
  let response;
2663
- let errorCode = "UnknownError";
2664
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2666
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2665
2667
  switch (errorCode) {
2666
2668
  case "BadRequestException":
2667
2669
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2677,10 +2679,12 @@ const deserializeAws_restJson1ListS3BucketsCommandError = async (output, context
2677
2679
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2678
2680
  default:
2679
2681
  const parsedBody = parsedOutput.body;
2682
+ const $metadata = deserializeMetadata(output);
2683
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2680
2684
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2681
- name: parsedBody.code || parsedBody.Code || errorCode,
2685
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2682
2686
  $fault: "client",
2683
- $metadata: deserializeMetadata(output),
2687
+ $metadata,
2684
2688
  });
2685
2689
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2686
2690
  }
@@ -2722,8 +2726,7 @@ const deserializeAws_restJson1RemoveAllBackendsCommandError = async (output, con
2722
2726
  body: await parseBody(output.body, context),
2723
2727
  };
2724
2728
  let response;
2725
- let errorCode = "UnknownError";
2726
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2729
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2727
2730
  switch (errorCode) {
2728
2731
  case "BadRequestException":
2729
2732
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2739,10 +2742,12 @@ const deserializeAws_restJson1RemoveAllBackendsCommandError = async (output, con
2739
2742
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2740
2743
  default:
2741
2744
  const parsedBody = parsedOutput.body;
2745
+ const $metadata = deserializeMetadata(output);
2746
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2742
2747
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2743
- name: parsedBody.code || parsedBody.Code || errorCode,
2748
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2744
2749
  $fault: "client",
2745
- $metadata: deserializeMetadata(output),
2750
+ $metadata,
2746
2751
  });
2747
2752
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2748
2753
  }
@@ -2768,8 +2773,7 @@ const deserializeAws_restJson1RemoveBackendConfigCommandError = async (output, c
2768
2773
  body: await parseBody(output.body, context),
2769
2774
  };
2770
2775
  let response;
2771
- let errorCode = "UnknownError";
2772
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2776
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2773
2777
  switch (errorCode) {
2774
2778
  case "BadRequestException":
2775
2779
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2785,10 +2789,12 @@ const deserializeAws_restJson1RemoveBackendConfigCommandError = async (output, c
2785
2789
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2786
2790
  default:
2787
2791
  const parsedBody = parsedOutput.body;
2792
+ const $metadata = deserializeMetadata(output);
2793
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2788
2794
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2789
- name: parsedBody.code || parsedBody.Code || errorCode,
2795
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2790
2796
  $fault: "client",
2791
- $metadata: deserializeMetadata(output),
2797
+ $metadata,
2792
2798
  });
2793
2799
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2794
2800
  }
@@ -2834,8 +2840,7 @@ const deserializeAws_restJson1UpdateBackendAPICommandError = async (output, cont
2834
2840
  body: await parseBody(output.body, context),
2835
2841
  };
2836
2842
  let response;
2837
- let errorCode = "UnknownError";
2838
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2843
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2839
2844
  switch (errorCode) {
2840
2845
  case "BadRequestException":
2841
2846
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2851,10 +2856,12 @@ const deserializeAws_restJson1UpdateBackendAPICommandError = async (output, cont
2851
2856
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2852
2857
  default:
2853
2858
  const parsedBody = parsedOutput.body;
2859
+ const $metadata = deserializeMetadata(output);
2860
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2854
2861
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2855
- name: parsedBody.code || parsedBody.Code || errorCode,
2862
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2856
2863
  $fault: "client",
2857
- $metadata: deserializeMetadata(output),
2864
+ $metadata,
2858
2865
  });
2859
2866
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2860
2867
  }
@@ -2900,8 +2907,7 @@ const deserializeAws_restJson1UpdateBackendAuthCommandError = async (output, con
2900
2907
  body: await parseBody(output.body, context),
2901
2908
  };
2902
2909
  let response;
2903
- let errorCode = "UnknownError";
2904
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2910
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2905
2911
  switch (errorCode) {
2906
2912
  case "BadRequestException":
2907
2913
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2917,10 +2923,12 @@ const deserializeAws_restJson1UpdateBackendAuthCommandError = async (output, con
2917
2923
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2918
2924
  default:
2919
2925
  const parsedBody = parsedOutput.body;
2926
+ const $metadata = deserializeMetadata(output);
2927
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2920
2928
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2921
- name: parsedBody.code || parsedBody.Code || errorCode,
2929
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2922
2930
  $fault: "client",
2923
- $metadata: deserializeMetadata(output),
2931
+ $metadata,
2924
2932
  });
2925
2933
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2926
2934
  }
@@ -2958,8 +2966,7 @@ const deserializeAws_restJson1UpdateBackendConfigCommandError = async (output, c
2958
2966
  body: await parseBody(output.body, context),
2959
2967
  };
2960
2968
  let response;
2961
- let errorCode = "UnknownError";
2962
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2969
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2963
2970
  switch (errorCode) {
2964
2971
  case "BadRequestException":
2965
2972
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -2975,10 +2982,12 @@ const deserializeAws_restJson1UpdateBackendConfigCommandError = async (output, c
2975
2982
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2976
2983
  default:
2977
2984
  const parsedBody = parsedOutput.body;
2985
+ const $metadata = deserializeMetadata(output);
2986
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2978
2987
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
2979
- name: parsedBody.code || parsedBody.Code || errorCode,
2988
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2980
2989
  $fault: "client",
2981
- $metadata: deserializeMetadata(output),
2990
+ $metadata,
2982
2991
  });
2983
2992
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2984
2993
  }
@@ -3032,8 +3041,7 @@ const deserializeAws_restJson1UpdateBackendJobCommandError = async (output, cont
3032
3041
  body: await parseBody(output.body, context),
3033
3042
  };
3034
3043
  let response;
3035
- let errorCode = "UnknownError";
3036
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3044
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3037
3045
  switch (errorCode) {
3038
3046
  case "BadRequestException":
3039
3047
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -3049,10 +3057,12 @@ const deserializeAws_restJson1UpdateBackendJobCommandError = async (output, cont
3049
3057
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3050
3058
  default:
3051
3059
  const parsedBody = parsedOutput.body;
3060
+ const $metadata = deserializeMetadata(output);
3061
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3052
3062
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
3053
- name: parsedBody.code || parsedBody.Code || errorCode,
3063
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3054
3064
  $fault: "client",
3055
- $metadata: deserializeMetadata(output),
3065
+ $metadata,
3056
3066
  });
3057
3067
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3058
3068
  }
@@ -3090,8 +3100,7 @@ const deserializeAws_restJson1UpdateBackendStorageCommandError = async (output,
3090
3100
  body: await parseBody(output.body, context),
3091
3101
  };
3092
3102
  let response;
3093
- let errorCode = "UnknownError";
3094
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3103
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3095
3104
  switch (errorCode) {
3096
3105
  case "BadRequestException":
3097
3106
  case "com.amazonaws.amplifybackend#BadRequestException":
@@ -3107,10 +3116,12 @@ const deserializeAws_restJson1UpdateBackendStorageCommandError = async (output,
3107
3116
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3108
3117
  default:
3109
3118
  const parsedBody = parsedOutput.body;
3119
+ const $metadata = deserializeMetadata(output);
3120
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3110
3121
  response = new AmplifyBackendServiceException_1.AmplifyBackendServiceException({
3111
- name: parsedBody.code || parsedBody.Code || errorCode,
3122
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3112
3123
  $fault: "client",
3113
- $metadata: deserializeMetadata(output),
3124
+ $metadata,
3114
3125
  });
3115
3126
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3116
3127
  }
@@ -3171,208 +3182,170 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
3171
3182
  };
3172
3183
  const serializeAws_restJson1BackendAPIAppSyncAuthSettings = (input, context) => {
3173
3184
  return {
3174
- ...(input.CognitoUserPoolId !== undefined &&
3175
- input.CognitoUserPoolId !== null && { cognitoUserPoolId: input.CognitoUserPoolId }),
3176
- ...(input.Description !== undefined && input.Description !== null && { description: input.Description }),
3177
- ...(input.ExpirationTime !== undefined &&
3178
- input.ExpirationTime !== null && { expirationTime: (0, smithy_client_1.serializeFloat)(input.ExpirationTime) }),
3179
- ...(input.OpenIDAuthTTL !== undefined && input.OpenIDAuthTTL !== null && { openIDAuthTTL: input.OpenIDAuthTTL }),
3180
- ...(input.OpenIDClientId !== undefined &&
3181
- input.OpenIDClientId !== null && { openIDClientId: input.OpenIDClientId }),
3182
- ...(input.OpenIDIatTTL !== undefined && input.OpenIDIatTTL !== null && { openIDIatTTL: input.OpenIDIatTTL }),
3183
- ...(input.OpenIDIssueURL !== undefined &&
3184
- input.OpenIDIssueURL !== null && { openIDIssueURL: input.OpenIDIssueURL }),
3185
- ...(input.OpenIDProviderName !== undefined &&
3186
- input.OpenIDProviderName !== null && { openIDProviderName: input.OpenIDProviderName }),
3185
+ ...(input.CognitoUserPoolId != null && { cognitoUserPoolId: input.CognitoUserPoolId }),
3186
+ ...(input.Description != null && { description: input.Description }),
3187
+ ...(input.ExpirationTime != null && { expirationTime: (0, smithy_client_1.serializeFloat)(input.ExpirationTime) }),
3188
+ ...(input.OpenIDAuthTTL != null && { openIDAuthTTL: input.OpenIDAuthTTL }),
3189
+ ...(input.OpenIDClientId != null && { openIDClientId: input.OpenIDClientId }),
3190
+ ...(input.OpenIDIatTTL != null && { openIDIatTTL: input.OpenIDIatTTL }),
3191
+ ...(input.OpenIDIssueURL != null && { openIDIssueURL: input.OpenIDIssueURL }),
3192
+ ...(input.OpenIDProviderName != null && { openIDProviderName: input.OpenIDProviderName }),
3187
3193
  };
3188
3194
  };
3189
3195
  const serializeAws_restJson1BackendAPIAuthType = (input, context) => {
3190
3196
  return {
3191
- ...(input.Mode !== undefined && input.Mode !== null && { mode: input.Mode }),
3192
- ...(input.Settings !== undefined &&
3193
- input.Settings !== null && {
3197
+ ...(input.Mode != null && { mode: input.Mode }),
3198
+ ...(input.Settings != null && {
3194
3199
  settings: serializeAws_restJson1BackendAPIAppSyncAuthSettings(input.Settings, context),
3195
3200
  }),
3196
3201
  };
3197
3202
  };
3198
3203
  const serializeAws_restJson1BackendAPIConflictResolution = (input, context) => {
3199
3204
  return {
3200
- ...(input.ResolutionStrategy !== undefined &&
3201
- input.ResolutionStrategy !== null && { resolutionStrategy: input.ResolutionStrategy }),
3205
+ ...(input.ResolutionStrategy != null && { resolutionStrategy: input.ResolutionStrategy }),
3202
3206
  };
3203
3207
  };
3204
3208
  const serializeAws_restJson1BackendAPIResourceConfig = (input, context) => {
3205
3209
  return {
3206
- ...(input.AdditionalAuthTypes !== undefined &&
3207
- input.AdditionalAuthTypes !== null && {
3210
+ ...(input.AdditionalAuthTypes != null && {
3208
3211
  additionalAuthTypes: serializeAws_restJson1ListOfBackendAPIAuthType(input.AdditionalAuthTypes, context),
3209
3212
  }),
3210
- ...(input.ApiName !== undefined && input.ApiName !== null && { apiName: input.ApiName }),
3211
- ...(input.ConflictResolution !== undefined &&
3212
- input.ConflictResolution !== null && {
3213
+ ...(input.ApiName != null && { apiName: input.ApiName }),
3214
+ ...(input.ConflictResolution != null && {
3213
3215
  conflictResolution: serializeAws_restJson1BackendAPIConflictResolution(input.ConflictResolution, context),
3214
3216
  }),
3215
- ...(input.DefaultAuthType !== undefined &&
3216
- input.DefaultAuthType !== null && {
3217
+ ...(input.DefaultAuthType != null && {
3217
3218
  defaultAuthType: serializeAws_restJson1BackendAPIAuthType(input.DefaultAuthType, context),
3218
3219
  }),
3219
- ...(input.Service !== undefined && input.Service !== null && { service: input.Service }),
3220
- ...(input.TransformSchema !== undefined &&
3221
- input.TransformSchema !== null && { transformSchema: input.TransformSchema }),
3220
+ ...(input.Service != null && { service: input.Service }),
3221
+ ...(input.TransformSchema != null && { transformSchema: input.TransformSchema }),
3222
3222
  };
3223
3223
  };
3224
3224
  const serializeAws_restJson1BackendAuthAppleProviderConfig = (input, context) => {
3225
3225
  return {
3226
- ...(input.ClientId !== undefined && input.ClientId !== null && { client_id: input.ClientId }),
3227
- ...(input.KeyId !== undefined && input.KeyId !== null && { key_id: input.KeyId }),
3228
- ...(input.PrivateKey !== undefined && input.PrivateKey !== null && { private_key: input.PrivateKey }),
3229
- ...(input.TeamId !== undefined && input.TeamId !== null && { team_id: input.TeamId }),
3226
+ ...(input.ClientId != null && { client_id: input.ClientId }),
3227
+ ...(input.KeyId != null && { key_id: input.KeyId }),
3228
+ ...(input.PrivateKey != null && { private_key: input.PrivateKey }),
3229
+ ...(input.TeamId != null && { team_id: input.TeamId }),
3230
3230
  };
3231
3231
  };
3232
3232
  const serializeAws_restJson1BackendAuthSocialProviderConfig = (input, context) => {
3233
3233
  return {
3234
- ...(input.ClientId !== undefined && input.ClientId !== null && { client_id: input.ClientId }),
3235
- ...(input.ClientSecret !== undefined && input.ClientSecret !== null && { client_secret: input.ClientSecret }),
3234
+ ...(input.ClientId != null && { client_id: input.ClientId }),
3235
+ ...(input.ClientSecret != null && { client_secret: input.ClientSecret }),
3236
3236
  };
3237
3237
  };
3238
3238
  const serializeAws_restJson1BackendStoragePermissions = (input, context) => {
3239
3239
  return {
3240
- ...(input.Authenticated !== undefined &&
3241
- input.Authenticated !== null && {
3240
+ ...(input.Authenticated != null && {
3242
3241
  authenticated: serializeAws_restJson1ListOfAuthenticatedElement(input.Authenticated, context),
3243
3242
  }),
3244
- ...(input.UnAuthenticated !== undefined &&
3245
- input.UnAuthenticated !== null && {
3243
+ ...(input.UnAuthenticated != null && {
3246
3244
  unAuthenticated: serializeAws_restJson1ListOfUnAuthenticatedElement(input.UnAuthenticated, context),
3247
3245
  }),
3248
3246
  };
3249
3247
  };
3250
3248
  const serializeAws_restJson1CreateBackendAuthForgotPasswordConfig = (input, context) => {
3251
3249
  return {
3252
- ...(input.DeliveryMethod !== undefined &&
3253
- input.DeliveryMethod !== null && { deliveryMethod: input.DeliveryMethod }),
3254
- ...(input.EmailSettings !== undefined &&
3255
- input.EmailSettings !== null && {
3250
+ ...(input.DeliveryMethod != null && { deliveryMethod: input.DeliveryMethod }),
3251
+ ...(input.EmailSettings != null && {
3256
3252
  emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context),
3257
3253
  }),
3258
- ...(input.SmsSettings !== undefined &&
3259
- input.SmsSettings !== null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3254
+ ...(input.SmsSettings != null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3260
3255
  };
3261
3256
  };
3262
3257
  const serializeAws_restJson1CreateBackendAuthIdentityPoolConfig = (input, context) => {
3263
3258
  return {
3264
- ...(input.IdentityPoolName !== undefined &&
3265
- input.IdentityPoolName !== null && { identityPoolName: input.IdentityPoolName }),
3266
- ...(input.UnauthenticatedLogin !== undefined &&
3267
- input.UnauthenticatedLogin !== null && { unauthenticatedLogin: input.UnauthenticatedLogin }),
3259
+ ...(input.IdentityPoolName != null && { identityPoolName: input.IdentityPoolName }),
3260
+ ...(input.UnauthenticatedLogin != null && { unauthenticatedLogin: input.UnauthenticatedLogin }),
3268
3261
  };
3269
3262
  };
3270
3263
  const serializeAws_restJson1CreateBackendAuthMFAConfig = (input, context) => {
3271
3264
  return {
3272
- ...(input.MFAMode !== undefined && input.MFAMode !== null && { MFAMode: input.MFAMode }),
3273
- ...(input.Settings !== undefined &&
3274
- input.Settings !== null && { settings: serializeAws_restJson1Settings(input.Settings, context) }),
3265
+ ...(input.MFAMode != null && { MFAMode: input.MFAMode }),
3266
+ ...(input.Settings != null && { settings: serializeAws_restJson1Settings(input.Settings, context) }),
3275
3267
  };
3276
3268
  };
3277
3269
  const serializeAws_restJson1CreateBackendAuthOAuthConfig = (input, context) => {
3278
3270
  return {
3279
- ...(input.DomainPrefix !== undefined && input.DomainPrefix !== null && { domainPrefix: input.DomainPrefix }),
3280
- ...(input.OAuthGrantType !== undefined &&
3281
- input.OAuthGrantType !== null && { oAuthGrantType: input.OAuthGrantType }),
3282
- ...(input.OAuthScopes !== undefined &&
3283
- input.OAuthScopes !== null && {
3271
+ ...(input.DomainPrefix != null && { domainPrefix: input.DomainPrefix }),
3272
+ ...(input.OAuthGrantType != null && { oAuthGrantType: input.OAuthGrantType }),
3273
+ ...(input.OAuthScopes != null && {
3284
3274
  oAuthScopes: serializeAws_restJson1ListOfOAuthScopesElement(input.OAuthScopes, context),
3285
3275
  }),
3286
- ...(input.RedirectSignInURIs !== undefined &&
3287
- input.RedirectSignInURIs !== null && {
3276
+ ...(input.RedirectSignInURIs != null && {
3288
3277
  redirectSignInURIs: serializeAws_restJson1ListOf__string(input.RedirectSignInURIs, context),
3289
3278
  }),
3290
- ...(input.RedirectSignOutURIs !== undefined &&
3291
- input.RedirectSignOutURIs !== null && {
3279
+ ...(input.RedirectSignOutURIs != null && {
3292
3280
  redirectSignOutURIs: serializeAws_restJson1ListOf__string(input.RedirectSignOutURIs, context),
3293
3281
  }),
3294
- ...(input.SocialProviderSettings !== undefined &&
3295
- input.SocialProviderSettings !== null && {
3282
+ ...(input.SocialProviderSettings != null && {
3296
3283
  socialProviderSettings: serializeAws_restJson1SocialProviderSettings(input.SocialProviderSettings, context),
3297
3284
  }),
3298
3285
  };
3299
3286
  };
3300
3287
  const serializeAws_restJson1CreateBackendAuthPasswordPolicyConfig = (input, context) => {
3301
3288
  return {
3302
- ...(input.AdditionalConstraints !== undefined &&
3303
- input.AdditionalConstraints !== null && {
3289
+ ...(input.AdditionalConstraints != null && {
3304
3290
  additionalConstraints: serializeAws_restJson1ListOfAdditionalConstraintsElement(input.AdditionalConstraints, context),
3305
3291
  }),
3306
- ...(input.MinimumLength !== undefined &&
3307
- input.MinimumLength !== null && { minimumLength: (0, smithy_client_1.serializeFloat)(input.MinimumLength) }),
3292
+ ...(input.MinimumLength != null && { minimumLength: (0, smithy_client_1.serializeFloat)(input.MinimumLength) }),
3308
3293
  };
3309
3294
  };
3310
3295
  const serializeAws_restJson1CreateBackendAuthResourceConfig = (input, context) => {
3311
3296
  return {
3312
- ...(input.AuthResources !== undefined && input.AuthResources !== null && { authResources: input.AuthResources }),
3313
- ...(input.IdentityPoolConfigs !== undefined &&
3314
- input.IdentityPoolConfigs !== null && {
3297
+ ...(input.AuthResources != null && { authResources: input.AuthResources }),
3298
+ ...(input.IdentityPoolConfigs != null && {
3315
3299
  identityPoolConfigs: serializeAws_restJson1CreateBackendAuthIdentityPoolConfig(input.IdentityPoolConfigs, context),
3316
3300
  }),
3317
- ...(input.Service !== undefined && input.Service !== null && { service: input.Service }),
3318
- ...(input.UserPoolConfigs !== undefined &&
3319
- input.UserPoolConfigs !== null && {
3301
+ ...(input.Service != null && { service: input.Service }),
3302
+ ...(input.UserPoolConfigs != null && {
3320
3303
  userPoolConfigs: serializeAws_restJson1CreateBackendAuthUserPoolConfig(input.UserPoolConfigs, context),
3321
3304
  }),
3322
3305
  };
3323
3306
  };
3324
3307
  const serializeAws_restJson1CreateBackendAuthUserPoolConfig = (input, context) => {
3325
3308
  return {
3326
- ...(input.ForgotPassword !== undefined &&
3327
- input.ForgotPassword !== null && {
3309
+ ...(input.ForgotPassword != null && {
3328
3310
  forgotPassword: serializeAws_restJson1CreateBackendAuthForgotPasswordConfig(input.ForgotPassword, context),
3329
3311
  }),
3330
- ...(input.Mfa !== undefined &&
3331
- input.Mfa !== null && { mfa: serializeAws_restJson1CreateBackendAuthMFAConfig(input.Mfa, context) }),
3332
- ...(input.OAuth !== undefined &&
3333
- input.OAuth !== null && { oAuth: serializeAws_restJson1CreateBackendAuthOAuthConfig(input.OAuth, context) }),
3334
- ...(input.PasswordPolicy !== undefined &&
3335
- input.PasswordPolicy !== null && {
3312
+ ...(input.Mfa != null && { mfa: serializeAws_restJson1CreateBackendAuthMFAConfig(input.Mfa, context) }),
3313
+ ...(input.OAuth != null && { oAuth: serializeAws_restJson1CreateBackendAuthOAuthConfig(input.OAuth, context) }),
3314
+ ...(input.PasswordPolicy != null && {
3336
3315
  passwordPolicy: serializeAws_restJson1CreateBackendAuthPasswordPolicyConfig(input.PasswordPolicy, context),
3337
3316
  }),
3338
- ...(input.RequiredSignUpAttributes !== undefined &&
3339
- input.RequiredSignUpAttributes !== null && {
3317
+ ...(input.RequiredSignUpAttributes != null && {
3340
3318
  requiredSignUpAttributes: serializeAws_restJson1ListOfRequiredSignUpAttributesElement(input.RequiredSignUpAttributes, context),
3341
3319
  }),
3342
- ...(input.SignInMethod !== undefined && input.SignInMethod !== null && { signInMethod: input.SignInMethod }),
3343
- ...(input.UserPoolName !== undefined && input.UserPoolName !== null && { userPoolName: input.UserPoolName }),
3344
- ...(input.VerificationMessage !== undefined &&
3345
- input.VerificationMessage !== null && {
3320
+ ...(input.SignInMethod != null && { signInMethod: input.SignInMethod }),
3321
+ ...(input.UserPoolName != null && { userPoolName: input.UserPoolName }),
3322
+ ...(input.VerificationMessage != null && {
3346
3323
  verificationMessage: serializeAws_restJson1CreateBackendAuthVerificationMessageConfig(input.VerificationMessage, context),
3347
3324
  }),
3348
3325
  };
3349
3326
  };
3350
3327
  const serializeAws_restJson1CreateBackendAuthVerificationMessageConfig = (input, context) => {
3351
3328
  return {
3352
- ...(input.DeliveryMethod !== undefined &&
3353
- input.DeliveryMethod !== null && { deliveryMethod: input.DeliveryMethod }),
3354
- ...(input.EmailSettings !== undefined &&
3355
- input.EmailSettings !== null && {
3329
+ ...(input.DeliveryMethod != null && { deliveryMethod: input.DeliveryMethod }),
3330
+ ...(input.EmailSettings != null && {
3356
3331
  emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context),
3357
3332
  }),
3358
- ...(input.SmsSettings !== undefined &&
3359
- input.SmsSettings !== null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3333
+ ...(input.SmsSettings != null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3360
3334
  };
3361
3335
  };
3362
3336
  const serializeAws_restJson1CreateBackendStorageResourceConfig = (input, context) => {
3363
3337
  return {
3364
- ...(input.BucketName !== undefined && input.BucketName !== null && { bucketName: input.BucketName }),
3365
- ...(input.Permissions !== undefined &&
3366
- input.Permissions !== null && {
3338
+ ...(input.BucketName != null && { bucketName: input.BucketName }),
3339
+ ...(input.Permissions != null && {
3367
3340
  permissions: serializeAws_restJson1BackendStoragePermissions(input.Permissions, context),
3368
3341
  }),
3369
- ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
3342
+ ...(input.ServiceName != null && { serviceName: input.ServiceName }),
3370
3343
  };
3371
3344
  };
3372
3345
  const serializeAws_restJson1EmailSettings = (input, context) => {
3373
3346
  return {
3374
- ...(input.EmailMessage !== undefined && input.EmailMessage !== null && { emailMessage: input.EmailMessage }),
3375
- ...(input.EmailSubject !== undefined && input.EmailSubject !== null && { emailSubject: input.EmailSubject }),
3347
+ ...(input.EmailMessage != null && { emailMessage: input.EmailMessage }),
3348
+ ...(input.EmailSubject != null && { emailSubject: input.EmailSubject }),
3376
3349
  };
3377
3350
  };
3378
3351
  const serializeAws_restJson1ListOf__string = (input, context) => {
@@ -3457,14 +3430,10 @@ const serializeAws_restJson1ListOfUnAuthenticatedElement = (input, context) => {
3457
3430
  };
3458
3431
  const serializeAws_restJson1LoginAuthConfigReqObj = (input, context) => {
3459
3432
  return {
3460
- ...(input.AwsCognitoIdentityPoolId !== undefined &&
3461
- input.AwsCognitoIdentityPoolId !== null && { aws_cognito_identity_pool_id: input.AwsCognitoIdentityPoolId }),
3462
- ...(input.AwsCognitoRegion !== undefined &&
3463
- input.AwsCognitoRegion !== null && { aws_cognito_region: input.AwsCognitoRegion }),
3464
- ...(input.AwsUserPoolsId !== undefined &&
3465
- input.AwsUserPoolsId !== null && { aws_user_pools_id: input.AwsUserPoolsId }),
3466
- ...(input.AwsUserPoolsWebClientId !== undefined &&
3467
- input.AwsUserPoolsWebClientId !== null && { aws_user_pools_web_client_id: input.AwsUserPoolsWebClientId }),
3433
+ ...(input.AwsCognitoIdentityPoolId != null && { aws_cognito_identity_pool_id: input.AwsCognitoIdentityPoolId }),
3434
+ ...(input.AwsCognitoRegion != null && { aws_cognito_region: input.AwsCognitoRegion }),
3435
+ ...(input.AwsUserPoolsId != null && { aws_user_pools_id: input.AwsUserPoolsId }),
3436
+ ...(input.AwsUserPoolsWebClientId != null && { aws_user_pools_web_client_id: input.AwsUserPoolsWebClientId }),
3468
3437
  };
3469
3438
  };
3470
3439
  const serializeAws_restJson1ResourceConfig = (input, context) => {
@@ -3472,147 +3441,119 @@ const serializeAws_restJson1ResourceConfig = (input, context) => {
3472
3441
  };
3473
3442
  const serializeAws_restJson1Settings = (input, context) => {
3474
3443
  return {
3475
- ...(input.MfaTypes !== undefined &&
3476
- input.MfaTypes !== null && { mfaTypes: serializeAws_restJson1ListOfMfaTypesElement(input.MfaTypes, context) }),
3477
- ...(input.SmsMessage !== undefined && input.SmsMessage !== null && { smsMessage: input.SmsMessage }),
3444
+ ...(input.MfaTypes != null && { mfaTypes: serializeAws_restJson1ListOfMfaTypesElement(input.MfaTypes, context) }),
3445
+ ...(input.SmsMessage != null && { smsMessage: input.SmsMessage }),
3478
3446
  };
3479
3447
  };
3480
3448
  const serializeAws_restJson1SmsSettings = (input, context) => {
3481
3449
  return {
3482
- ...(input.SmsMessage !== undefined && input.SmsMessage !== null && { smsMessage: input.SmsMessage }),
3450
+ ...(input.SmsMessage != null && { smsMessage: input.SmsMessage }),
3483
3451
  };
3484
3452
  };
3485
3453
  const serializeAws_restJson1SocialProviderSettings = (input, context) => {
3486
3454
  return {
3487
- ...(input.Facebook !== undefined &&
3488
- input.Facebook !== null && {
3455
+ ...(input.Facebook != null && {
3489
3456
  Facebook: serializeAws_restJson1BackendAuthSocialProviderConfig(input.Facebook, context),
3490
3457
  }),
3491
- ...(input.Google !== undefined &&
3492
- input.Google !== null && {
3458
+ ...(input.Google != null && {
3493
3459
  Google: serializeAws_restJson1BackendAuthSocialProviderConfig(input.Google, context),
3494
3460
  }),
3495
- ...(input.LoginWithAmazon !== undefined &&
3496
- input.LoginWithAmazon !== null && {
3461
+ ...(input.LoginWithAmazon != null && {
3497
3462
  LoginWithAmazon: serializeAws_restJson1BackendAuthSocialProviderConfig(input.LoginWithAmazon, context),
3498
3463
  }),
3499
- ...(input.SignInWithApple !== undefined &&
3500
- input.SignInWithApple !== null && {
3464
+ ...(input.SignInWithApple != null && {
3501
3465
  SignInWithApple: serializeAws_restJson1BackendAuthAppleProviderConfig(input.SignInWithApple, context),
3502
3466
  }),
3503
3467
  };
3504
3468
  };
3505
3469
  const serializeAws_restJson1UpdateBackendAuthForgotPasswordConfig = (input, context) => {
3506
3470
  return {
3507
- ...(input.DeliveryMethod !== undefined &&
3508
- input.DeliveryMethod !== null && { deliveryMethod: input.DeliveryMethod }),
3509
- ...(input.EmailSettings !== undefined &&
3510
- input.EmailSettings !== null && {
3471
+ ...(input.DeliveryMethod != null && { deliveryMethod: input.DeliveryMethod }),
3472
+ ...(input.EmailSettings != null && {
3511
3473
  emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context),
3512
3474
  }),
3513
- ...(input.SmsSettings !== undefined &&
3514
- input.SmsSettings !== null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3475
+ ...(input.SmsSettings != null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3515
3476
  };
3516
3477
  };
3517
3478
  const serializeAws_restJson1UpdateBackendAuthIdentityPoolConfig = (input, context) => {
3518
3479
  return {
3519
- ...(input.UnauthenticatedLogin !== undefined &&
3520
- input.UnauthenticatedLogin !== null && { unauthenticatedLogin: input.UnauthenticatedLogin }),
3480
+ ...(input.UnauthenticatedLogin != null && { unauthenticatedLogin: input.UnauthenticatedLogin }),
3521
3481
  };
3522
3482
  };
3523
3483
  const serializeAws_restJson1UpdateBackendAuthMFAConfig = (input, context) => {
3524
3484
  return {
3525
- ...(input.MFAMode !== undefined && input.MFAMode !== null && { MFAMode: input.MFAMode }),
3526
- ...(input.Settings !== undefined &&
3527
- input.Settings !== null && { settings: serializeAws_restJson1Settings(input.Settings, context) }),
3485
+ ...(input.MFAMode != null && { MFAMode: input.MFAMode }),
3486
+ ...(input.Settings != null && { settings: serializeAws_restJson1Settings(input.Settings, context) }),
3528
3487
  };
3529
3488
  };
3530
3489
  const serializeAws_restJson1UpdateBackendAuthOAuthConfig = (input, context) => {
3531
3490
  return {
3532
- ...(input.DomainPrefix !== undefined && input.DomainPrefix !== null && { domainPrefix: input.DomainPrefix }),
3533
- ...(input.OAuthGrantType !== undefined &&
3534
- input.OAuthGrantType !== null && { oAuthGrantType: input.OAuthGrantType }),
3535
- ...(input.OAuthScopes !== undefined &&
3536
- input.OAuthScopes !== null && {
3491
+ ...(input.DomainPrefix != null && { domainPrefix: input.DomainPrefix }),
3492
+ ...(input.OAuthGrantType != null && { oAuthGrantType: input.OAuthGrantType }),
3493
+ ...(input.OAuthScopes != null && {
3537
3494
  oAuthScopes: serializeAws_restJson1ListOfOAuthScopesElement(input.OAuthScopes, context),
3538
3495
  }),
3539
- ...(input.RedirectSignInURIs !== undefined &&
3540
- input.RedirectSignInURIs !== null && {
3496
+ ...(input.RedirectSignInURIs != null && {
3541
3497
  redirectSignInURIs: serializeAws_restJson1ListOf__string(input.RedirectSignInURIs, context),
3542
3498
  }),
3543
- ...(input.RedirectSignOutURIs !== undefined &&
3544
- input.RedirectSignOutURIs !== null && {
3499
+ ...(input.RedirectSignOutURIs != null && {
3545
3500
  redirectSignOutURIs: serializeAws_restJson1ListOf__string(input.RedirectSignOutURIs, context),
3546
3501
  }),
3547
- ...(input.SocialProviderSettings !== undefined &&
3548
- input.SocialProviderSettings !== null && {
3502
+ ...(input.SocialProviderSettings != null && {
3549
3503
  socialProviderSettings: serializeAws_restJson1SocialProviderSettings(input.SocialProviderSettings, context),
3550
3504
  }),
3551
3505
  };
3552
3506
  };
3553
3507
  const serializeAws_restJson1UpdateBackendAuthPasswordPolicyConfig = (input, context) => {
3554
3508
  return {
3555
- ...(input.AdditionalConstraints !== undefined &&
3556
- input.AdditionalConstraints !== null && {
3509
+ ...(input.AdditionalConstraints != null && {
3557
3510
  additionalConstraints: serializeAws_restJson1ListOfAdditionalConstraintsElement(input.AdditionalConstraints, context),
3558
3511
  }),
3559
- ...(input.MinimumLength !== undefined &&
3560
- input.MinimumLength !== null && { minimumLength: (0, smithy_client_1.serializeFloat)(input.MinimumLength) }),
3512
+ ...(input.MinimumLength != null && { minimumLength: (0, smithy_client_1.serializeFloat)(input.MinimumLength) }),
3561
3513
  };
3562
3514
  };
3563
3515
  const serializeAws_restJson1UpdateBackendAuthResourceConfig = (input, context) => {
3564
3516
  return {
3565
- ...(input.AuthResources !== undefined && input.AuthResources !== null && { authResources: input.AuthResources }),
3566
- ...(input.IdentityPoolConfigs !== undefined &&
3567
- input.IdentityPoolConfigs !== null && {
3517
+ ...(input.AuthResources != null && { authResources: input.AuthResources }),
3518
+ ...(input.IdentityPoolConfigs != null && {
3568
3519
  identityPoolConfigs: serializeAws_restJson1UpdateBackendAuthIdentityPoolConfig(input.IdentityPoolConfigs, context),
3569
3520
  }),
3570
- ...(input.Service !== undefined && input.Service !== null && { service: input.Service }),
3571
- ...(input.UserPoolConfigs !== undefined &&
3572
- input.UserPoolConfigs !== null && {
3521
+ ...(input.Service != null && { service: input.Service }),
3522
+ ...(input.UserPoolConfigs != null && {
3573
3523
  userPoolConfigs: serializeAws_restJson1UpdateBackendAuthUserPoolConfig(input.UserPoolConfigs, context),
3574
3524
  }),
3575
3525
  };
3576
3526
  };
3577
3527
  const serializeAws_restJson1UpdateBackendAuthUserPoolConfig = (input, context) => {
3578
3528
  return {
3579
- ...(input.ForgotPassword !== undefined &&
3580
- input.ForgotPassword !== null && {
3529
+ ...(input.ForgotPassword != null && {
3581
3530
  forgotPassword: serializeAws_restJson1UpdateBackendAuthForgotPasswordConfig(input.ForgotPassword, context),
3582
3531
  }),
3583
- ...(input.Mfa !== undefined &&
3584
- input.Mfa !== null && { mfa: serializeAws_restJson1UpdateBackendAuthMFAConfig(input.Mfa, context) }),
3585
- ...(input.OAuth !== undefined &&
3586
- input.OAuth !== null && { oAuth: serializeAws_restJson1UpdateBackendAuthOAuthConfig(input.OAuth, context) }),
3587
- ...(input.PasswordPolicy !== undefined &&
3588
- input.PasswordPolicy !== null && {
3532
+ ...(input.Mfa != null && { mfa: serializeAws_restJson1UpdateBackendAuthMFAConfig(input.Mfa, context) }),
3533
+ ...(input.OAuth != null && { oAuth: serializeAws_restJson1UpdateBackendAuthOAuthConfig(input.OAuth, context) }),
3534
+ ...(input.PasswordPolicy != null && {
3589
3535
  passwordPolicy: serializeAws_restJson1UpdateBackendAuthPasswordPolicyConfig(input.PasswordPolicy, context),
3590
3536
  }),
3591
- ...(input.VerificationMessage !== undefined &&
3592
- input.VerificationMessage !== null && {
3537
+ ...(input.VerificationMessage != null && {
3593
3538
  verificationMessage: serializeAws_restJson1UpdateBackendAuthVerificationMessageConfig(input.VerificationMessage, context),
3594
3539
  }),
3595
3540
  };
3596
3541
  };
3597
3542
  const serializeAws_restJson1UpdateBackendAuthVerificationMessageConfig = (input, context) => {
3598
3543
  return {
3599
- ...(input.DeliveryMethod !== undefined &&
3600
- input.DeliveryMethod !== null && { deliveryMethod: input.DeliveryMethod }),
3601
- ...(input.EmailSettings !== undefined &&
3602
- input.EmailSettings !== null && {
3544
+ ...(input.DeliveryMethod != null && { deliveryMethod: input.DeliveryMethod }),
3545
+ ...(input.EmailSettings != null && {
3603
3546
  emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context),
3604
3547
  }),
3605
- ...(input.SmsSettings !== undefined &&
3606
- input.SmsSettings !== null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3548
+ ...(input.SmsSettings != null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }),
3607
3549
  };
3608
3550
  };
3609
3551
  const serializeAws_restJson1UpdateBackendStorageResourceConfig = (input, context) => {
3610
3552
  return {
3611
- ...(input.Permissions !== undefined &&
3612
- input.Permissions !== null && {
3553
+ ...(input.Permissions != null && {
3613
3554
  permissions: serializeAws_restJson1BackendStoragePermissions(input.Permissions, context),
3614
3555
  }),
3615
- ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }),
3556
+ ...(input.ServiceName != null && { serviceName: input.ServiceName }),
3616
3557
  };
3617
3558
  };
3618
3559
  const deserializeAws_restJson1BackendAPIAppSyncAuthSettings = (output, context) => {
@@ -3630,7 +3571,7 @@ const deserializeAws_restJson1BackendAPIAppSyncAuthSettings = (output, context)
3630
3571
  const deserializeAws_restJson1BackendAPIAuthType = (output, context) => {
3631
3572
  return {
3632
3573
  Mode: (0, smithy_client_1.expectString)(output.mode),
3633
- Settings: output.settings !== undefined && output.settings !== null
3574
+ Settings: output.settings != null
3634
3575
  ? deserializeAws_restJson1BackendAPIAppSyncAuthSettings(output.settings, context)
3635
3576
  : undefined,
3636
3577
  };
@@ -3642,14 +3583,14 @@ const deserializeAws_restJson1BackendAPIConflictResolution = (output, context) =
3642
3583
  };
3643
3584
  const deserializeAws_restJson1BackendAPIResourceConfig = (output, context) => {
3644
3585
  return {
3645
- AdditionalAuthTypes: output.additionalAuthTypes !== undefined && output.additionalAuthTypes !== null
3586
+ AdditionalAuthTypes: output.additionalAuthTypes != null
3646
3587
  ? deserializeAws_restJson1ListOfBackendAPIAuthType(output.additionalAuthTypes, context)
3647
3588
  : undefined,
3648
3589
  ApiName: (0, smithy_client_1.expectString)(output.apiName),
3649
- ConflictResolution: output.conflictResolution !== undefined && output.conflictResolution !== null
3590
+ ConflictResolution: output.conflictResolution != null
3650
3591
  ? deserializeAws_restJson1BackendAPIConflictResolution(output.conflictResolution, context)
3651
3592
  : undefined,
3652
- DefaultAuthType: output.defaultAuthType !== undefined && output.defaultAuthType !== null
3593
+ DefaultAuthType: output.defaultAuthType != null
3653
3594
  ? deserializeAws_restJson1BackendAPIAuthType(output.defaultAuthType, context)
3654
3595
  : undefined,
3655
3596
  Service: (0, smithy_client_1.expectString)(output.service),
@@ -3684,10 +3625,10 @@ const deserializeAws_restJson1BackendJobRespObj = (output, context) => {
3684
3625
  };
3685
3626
  const deserializeAws_restJson1BackendStoragePermissions = (output, context) => {
3686
3627
  return {
3687
- Authenticated: output.authenticated !== undefined && output.authenticated !== null
3628
+ Authenticated: output.authenticated != null
3688
3629
  ? deserializeAws_restJson1ListOfAuthenticatedElement(output.authenticated, context)
3689
3630
  : undefined,
3690
- UnAuthenticated: output.unAuthenticated !== undefined && output.unAuthenticated !== null
3631
+ UnAuthenticated: output.unAuthenticated != null
3691
3632
  ? deserializeAws_restJson1ListOfUnAuthenticatedElement(output.unAuthenticated, context)
3692
3633
  : undefined,
3693
3634
  };
@@ -3695,12 +3636,8 @@ const deserializeAws_restJson1BackendStoragePermissions = (output, context) => {
3695
3636
  const deserializeAws_restJson1CreateBackendAuthForgotPasswordConfig = (output, context) => {
3696
3637
  return {
3697
3638
  DeliveryMethod: (0, smithy_client_1.expectString)(output.deliveryMethod),
3698
- EmailSettings: output.emailSettings !== undefined && output.emailSettings !== null
3699
- ? deserializeAws_restJson1EmailSettings(output.emailSettings, context)
3700
- : undefined,
3701
- SmsSettings: output.smsSettings !== undefined && output.smsSettings !== null
3702
- ? deserializeAws_restJson1SmsSettings(output.smsSettings, context)
3703
- : undefined,
3639
+ EmailSettings: output.emailSettings != null ? deserializeAws_restJson1EmailSettings(output.emailSettings, context) : undefined,
3640
+ SmsSettings: output.smsSettings != null ? deserializeAws_restJson1SmsSettings(output.smsSettings, context) : undefined,
3704
3641
  };
3705
3642
  };
3706
3643
  const deserializeAws_restJson1CreateBackendAuthIdentityPoolConfig = (output, context) => {
@@ -3712,32 +3649,30 @@ const deserializeAws_restJson1CreateBackendAuthIdentityPoolConfig = (output, con
3712
3649
  const deserializeAws_restJson1CreateBackendAuthMFAConfig = (output, context) => {
3713
3650
  return {
3714
3651
  MFAMode: (0, smithy_client_1.expectString)(output.MFAMode),
3715
- Settings: output.settings !== undefined && output.settings !== null
3716
- ? deserializeAws_restJson1Settings(output.settings, context)
3717
- : undefined,
3652
+ Settings: output.settings != null ? deserializeAws_restJson1Settings(output.settings, context) : undefined,
3718
3653
  };
3719
3654
  };
3720
3655
  const deserializeAws_restJson1CreateBackendAuthOAuthConfig = (output, context) => {
3721
3656
  return {
3722
3657
  DomainPrefix: (0, smithy_client_1.expectString)(output.domainPrefix),
3723
3658
  OAuthGrantType: (0, smithy_client_1.expectString)(output.oAuthGrantType),
3724
- OAuthScopes: output.oAuthScopes !== undefined && output.oAuthScopes !== null
3659
+ OAuthScopes: output.oAuthScopes != null
3725
3660
  ? deserializeAws_restJson1ListOfOAuthScopesElement(output.oAuthScopes, context)
3726
3661
  : undefined,
3727
- RedirectSignInURIs: output.redirectSignInURIs !== undefined && output.redirectSignInURIs !== null
3662
+ RedirectSignInURIs: output.redirectSignInURIs != null
3728
3663
  ? deserializeAws_restJson1ListOf__string(output.redirectSignInURIs, context)
3729
3664
  : undefined,
3730
- RedirectSignOutURIs: output.redirectSignOutURIs !== undefined && output.redirectSignOutURIs !== null
3665
+ RedirectSignOutURIs: output.redirectSignOutURIs != null
3731
3666
  ? deserializeAws_restJson1ListOf__string(output.redirectSignOutURIs, context)
3732
3667
  : undefined,
3733
- SocialProviderSettings: output.socialProviderSettings !== undefined && output.socialProviderSettings !== null
3668
+ SocialProviderSettings: output.socialProviderSettings != null
3734
3669
  ? deserializeAws_restJson1SocialProviderSettings(output.socialProviderSettings, context)
3735
3670
  : undefined,
3736
3671
  };
3737
3672
  };
3738
3673
  const deserializeAws_restJson1CreateBackendAuthPasswordPolicyConfig = (output, context) => {
3739
3674
  return {
3740
- AdditionalConstraints: output.additionalConstraints !== undefined && output.additionalConstraints !== null
3675
+ AdditionalConstraints: output.additionalConstraints != null
3741
3676
  ? deserializeAws_restJson1ListOfAdditionalConstraintsElement(output.additionalConstraints, context)
3742
3677
  : undefined,
3743
3678
  MinimumLength: (0, smithy_client_1.limitedParseDouble)(output.minimumLength),
@@ -3746,35 +3681,31 @@ const deserializeAws_restJson1CreateBackendAuthPasswordPolicyConfig = (output, c
3746
3681
  const deserializeAws_restJson1CreateBackendAuthResourceConfig = (output, context) => {
3747
3682
  return {
3748
3683
  AuthResources: (0, smithy_client_1.expectString)(output.authResources),
3749
- IdentityPoolConfigs: output.identityPoolConfigs !== undefined && output.identityPoolConfigs !== null
3684
+ IdentityPoolConfigs: output.identityPoolConfigs != null
3750
3685
  ? deserializeAws_restJson1CreateBackendAuthIdentityPoolConfig(output.identityPoolConfigs, context)
3751
3686
  : undefined,
3752
3687
  Service: (0, smithy_client_1.expectString)(output.service),
3753
- UserPoolConfigs: output.userPoolConfigs !== undefined && output.userPoolConfigs !== null
3688
+ UserPoolConfigs: output.userPoolConfigs != null
3754
3689
  ? deserializeAws_restJson1CreateBackendAuthUserPoolConfig(output.userPoolConfigs, context)
3755
3690
  : undefined,
3756
3691
  };
3757
3692
  };
3758
3693
  const deserializeAws_restJson1CreateBackendAuthUserPoolConfig = (output, context) => {
3759
3694
  return {
3760
- ForgotPassword: output.forgotPassword !== undefined && output.forgotPassword !== null
3695
+ ForgotPassword: output.forgotPassword != null
3761
3696
  ? deserializeAws_restJson1CreateBackendAuthForgotPasswordConfig(output.forgotPassword, context)
3762
3697
  : undefined,
3763
- Mfa: output.mfa !== undefined && output.mfa !== null
3764
- ? deserializeAws_restJson1CreateBackendAuthMFAConfig(output.mfa, context)
3765
- : undefined,
3766
- OAuth: output.oAuth !== undefined && output.oAuth !== null
3767
- ? deserializeAws_restJson1CreateBackendAuthOAuthConfig(output.oAuth, context)
3768
- : undefined,
3769
- PasswordPolicy: output.passwordPolicy !== undefined && output.passwordPolicy !== null
3698
+ Mfa: output.mfa != null ? deserializeAws_restJson1CreateBackendAuthMFAConfig(output.mfa, context) : undefined,
3699
+ OAuth: output.oAuth != null ? deserializeAws_restJson1CreateBackendAuthOAuthConfig(output.oAuth, context) : undefined,
3700
+ PasswordPolicy: output.passwordPolicy != null
3770
3701
  ? deserializeAws_restJson1CreateBackendAuthPasswordPolicyConfig(output.passwordPolicy, context)
3771
3702
  : undefined,
3772
- RequiredSignUpAttributes: output.requiredSignUpAttributes !== undefined && output.requiredSignUpAttributes !== null
3703
+ RequiredSignUpAttributes: output.requiredSignUpAttributes != null
3773
3704
  ? deserializeAws_restJson1ListOfRequiredSignUpAttributesElement(output.requiredSignUpAttributes, context)
3774
3705
  : undefined,
3775
3706
  SignInMethod: (0, smithy_client_1.expectString)(output.signInMethod),
3776
3707
  UserPoolName: (0, smithy_client_1.expectString)(output.userPoolName),
3777
- VerificationMessage: output.verificationMessage !== undefined && output.verificationMessage !== null
3708
+ VerificationMessage: output.verificationMessage != null
3778
3709
  ? deserializeAws_restJson1CreateBackendAuthVerificationMessageConfig(output.verificationMessage, context)
3779
3710
  : undefined,
3780
3711
  };
@@ -3782,12 +3713,8 @@ const deserializeAws_restJson1CreateBackendAuthUserPoolConfig = (output, context
3782
3713
  const deserializeAws_restJson1CreateBackendAuthVerificationMessageConfig = (output, context) => {
3783
3714
  return {
3784
3715
  DeliveryMethod: (0, smithy_client_1.expectString)(output.deliveryMethod),
3785
- EmailSettings: output.emailSettings !== undefined && output.emailSettings !== null
3786
- ? deserializeAws_restJson1EmailSettings(output.emailSettings, context)
3787
- : undefined,
3788
- SmsSettings: output.smsSettings !== undefined && output.smsSettings !== null
3789
- ? deserializeAws_restJson1SmsSettings(output.smsSettings, context)
3790
- : undefined,
3716
+ EmailSettings: output.emailSettings != null ? deserializeAws_restJson1EmailSettings(output.emailSettings, context) : undefined,
3717
+ SmsSettings: output.smsSettings != null ? deserializeAws_restJson1SmsSettings(output.smsSettings, context) : undefined,
3791
3718
  };
3792
3719
  };
3793
3720
  const deserializeAws_restJson1EmailSettings = (output, context) => {
@@ -3800,7 +3727,7 @@ const deserializeAws_restJson1GetBackendStorageResourceConfig = (output, context
3800
3727
  return {
3801
3728
  BucketName: (0, smithy_client_1.expectString)(output.bucketName),
3802
3729
  Imported: (0, smithy_client_1.expectBoolean)(output.imported),
3803
- Permissions: output.permissions !== undefined && output.permissions !== null
3730
+ Permissions: output.permissions != null
3804
3731
  ? deserializeAws_restJson1BackendStoragePermissions(output.permissions, context)
3805
3732
  : undefined,
3806
3733
  ServiceName: (0, smithy_client_1.expectString)(output.serviceName),
@@ -3932,9 +3859,7 @@ const deserializeAws_restJson1S3BucketInfo = (output, context) => {
3932
3859
  };
3933
3860
  const deserializeAws_restJson1Settings = (output, context) => {
3934
3861
  return {
3935
- MfaTypes: output.mfaTypes !== undefined && output.mfaTypes !== null
3936
- ? deserializeAws_restJson1ListOfMfaTypesElement(output.mfaTypes, context)
3937
- : undefined,
3862
+ MfaTypes: output.mfaTypes != null ? deserializeAws_restJson1ListOfMfaTypesElement(output.mfaTypes, context) : undefined,
3938
3863
  SmsMessage: (0, smithy_client_1.expectString)(output.smsMessage),
3939
3864
  };
3940
3865
  };
@@ -3945,16 +3870,16 @@ const deserializeAws_restJson1SmsSettings = (output, context) => {
3945
3870
  };
3946
3871
  const deserializeAws_restJson1SocialProviderSettings = (output, context) => {
3947
3872
  return {
3948
- Facebook: output.Facebook !== undefined && output.Facebook !== null
3873
+ Facebook: output.Facebook != null
3949
3874
  ? deserializeAws_restJson1BackendAuthSocialProviderConfig(output.Facebook, context)
3950
3875
  : undefined,
3951
- Google: output.Google !== undefined && output.Google !== null
3876
+ Google: output.Google != null
3952
3877
  ? deserializeAws_restJson1BackendAuthSocialProviderConfig(output.Google, context)
3953
3878
  : undefined,
3954
- LoginWithAmazon: output.LoginWithAmazon !== undefined && output.LoginWithAmazon !== null
3879
+ LoginWithAmazon: output.LoginWithAmazon != null
3955
3880
  ? deserializeAws_restJson1BackendAuthSocialProviderConfig(output.LoginWithAmazon, context)
3956
3881
  : undefined,
3957
- SignInWithApple: output.SignInWithApple !== undefined && output.SignInWithApple !== null
3882
+ SignInWithApple: output.SignInWithApple != null
3958
3883
  ? deserializeAws_restJson1BackendAuthAppleProviderConfig(output.SignInWithApple, context)
3959
3884
  : undefined,
3960
3885
  };
@@ -4008,5 +3933,4 @@ const loadRestJsonErrorCode = (output, data) => {
4008
3933
  if (data["__type"] !== undefined) {
4009
3934
  return sanitizeErrorCode(data["__type"]);
4010
3935
  }
4011
- return "";
4012
3936
  };