@aws-sdk/client-appsync 3.118.1 → 3.127.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.
@@ -11,7 +11,8 @@ const serializeAws_restJson1AssociateApiCommand = async (input, context) => {
11
11
  const headers = {
12
12
  "content-type": "application/json",
13
13
  };
14
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames/{domainName}/apiassociation";
14
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
15
+ "/v1/domainnames/{domainName}/apiassociation";
15
16
  if (input.domainName !== undefined) {
16
17
  const labelValue = input.domainName;
17
18
  if (labelValue.length <= 0) {
@@ -24,7 +25,7 @@ const serializeAws_restJson1AssociateApiCommand = async (input, context) => {
24
25
  }
25
26
  let body;
26
27
  body = JSON.stringify({
27
- ...(input.apiId !== undefined && input.apiId !== null && { apiId: input.apiId }),
28
+ ...(input.apiId != null && { apiId: input.apiId }),
28
29
  });
29
30
  return new protocol_http_1.HttpRequest({
30
31
  protocol,
@@ -55,14 +56,11 @@ const serializeAws_restJson1CreateApiCacheCommand = async (input, context) => {
55
56
  }
56
57
  let body;
57
58
  body = JSON.stringify({
58
- ...(input.apiCachingBehavior !== undefined &&
59
- input.apiCachingBehavior !== null && { apiCachingBehavior: input.apiCachingBehavior }),
60
- ...(input.atRestEncryptionEnabled !== undefined &&
61
- input.atRestEncryptionEnabled !== null && { atRestEncryptionEnabled: input.atRestEncryptionEnabled }),
62
- ...(input.transitEncryptionEnabled !== undefined &&
63
- input.transitEncryptionEnabled !== null && { transitEncryptionEnabled: input.transitEncryptionEnabled }),
64
- ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }),
65
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
59
+ ...(input.apiCachingBehavior != null && { apiCachingBehavior: input.apiCachingBehavior }),
60
+ ...(input.atRestEncryptionEnabled != null && { atRestEncryptionEnabled: input.atRestEncryptionEnabled }),
61
+ ...(input.transitEncryptionEnabled != null && { transitEncryptionEnabled: input.transitEncryptionEnabled }),
62
+ ...(input.ttl != null && { ttl: input.ttl }),
63
+ ...(input.type != null && { type: input.type }),
66
64
  });
67
65
  return new protocol_http_1.HttpRequest({
68
66
  protocol,
@@ -93,8 +91,8 @@ const serializeAws_restJson1CreateApiKeyCommand = async (input, context) => {
93
91
  }
94
92
  let body;
95
93
  body = JSON.stringify({
96
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
97
- ...(input.expires !== undefined && input.expires !== null && { expires: input.expires }),
94
+ ...(input.description != null && { description: input.description }),
95
+ ...(input.expires != null && { expires: input.expires }),
98
96
  });
99
97
  return new protocol_http_1.HttpRequest({
100
98
  protocol,
@@ -125,35 +123,28 @@ const serializeAws_restJson1CreateDataSourceCommand = async (input, context) =>
125
123
  }
126
124
  let body;
127
125
  body = JSON.stringify({
128
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
129
- ...(input.dynamodbConfig !== undefined &&
130
- input.dynamodbConfig !== null && {
126
+ ...(input.description != null && { description: input.description }),
127
+ ...(input.dynamodbConfig != null && {
131
128
  dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context),
132
129
  }),
133
- ...(input.elasticsearchConfig !== undefined &&
134
- input.elasticsearchConfig !== null && {
130
+ ...(input.elasticsearchConfig != null && {
135
131
  elasticsearchConfig: serializeAws_restJson1ElasticsearchDataSourceConfig(input.elasticsearchConfig, context),
136
132
  }),
137
- ...(input.httpConfig !== undefined &&
138
- input.httpConfig !== null && {
133
+ ...(input.httpConfig != null && {
139
134
  httpConfig: serializeAws_restJson1HttpDataSourceConfig(input.httpConfig, context),
140
135
  }),
141
- ...(input.lambdaConfig !== undefined &&
142
- input.lambdaConfig !== null && {
136
+ ...(input.lambdaConfig != null && {
143
137
  lambdaConfig: serializeAws_restJson1LambdaDataSourceConfig(input.lambdaConfig, context),
144
138
  }),
145
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
146
- ...(input.openSearchServiceConfig !== undefined &&
147
- input.openSearchServiceConfig !== null && {
139
+ ...(input.name != null && { name: input.name }),
140
+ ...(input.openSearchServiceConfig != null && {
148
141
  openSearchServiceConfig: serializeAws_restJson1OpenSearchServiceDataSourceConfig(input.openSearchServiceConfig, context),
149
142
  }),
150
- ...(input.relationalDatabaseConfig !== undefined &&
151
- input.relationalDatabaseConfig !== null && {
143
+ ...(input.relationalDatabaseConfig != null && {
152
144
  relationalDatabaseConfig: serializeAws_restJson1RelationalDatabaseDataSourceConfig(input.relationalDatabaseConfig, context),
153
145
  }),
154
- ...(input.serviceRoleArn !== undefined &&
155
- input.serviceRoleArn !== null && { serviceRoleArn: input.serviceRoleArn }),
156
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
146
+ ...(input.serviceRoleArn != null && { serviceRoleArn: input.serviceRoleArn }),
147
+ ...(input.type != null && { type: input.type }),
157
148
  });
158
149
  return new protocol_http_1.HttpRequest({
159
150
  protocol,
@@ -171,13 +162,12 @@ const serializeAws_restJson1CreateDomainNameCommand = async (input, context) =>
171
162
  const headers = {
172
163
  "content-type": "application/json",
173
164
  };
174
- const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames";
165
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domainnames";
175
166
  let body;
176
167
  body = JSON.stringify({
177
- ...(input.certificateArn !== undefined &&
178
- input.certificateArn !== null && { certificateArn: input.certificateArn }),
179
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
180
- ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }),
168
+ ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
169
+ ...(input.description != null && { description: input.description }),
170
+ ...(input.domainName != null && { domainName: input.domainName }),
181
171
  });
182
172
  return new protocol_http_1.HttpRequest({
183
173
  protocol,
@@ -208,19 +198,14 @@ const serializeAws_restJson1CreateFunctionCommand = async (input, context) => {
208
198
  }
209
199
  let body;
210
200
  body = JSON.stringify({
211
- ...(input.dataSourceName !== undefined &&
212
- input.dataSourceName !== null && { dataSourceName: input.dataSourceName }),
213
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
214
- ...(input.functionVersion !== undefined &&
215
- input.functionVersion !== null && { functionVersion: input.functionVersion }),
216
- ...(input.maxBatchSize !== undefined && input.maxBatchSize !== null && { maxBatchSize: input.maxBatchSize }),
217
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
218
- ...(input.requestMappingTemplate !== undefined &&
219
- input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }),
220
- ...(input.responseMappingTemplate !== undefined &&
221
- input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }),
222
- ...(input.syncConfig !== undefined &&
223
- input.syncConfig !== null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
201
+ ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
202
+ ...(input.description != null && { description: input.description }),
203
+ ...(input.functionVersion != null && { functionVersion: input.functionVersion }),
204
+ ...(input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize }),
205
+ ...(input.name != null && { name: input.name }),
206
+ ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
207
+ ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
208
+ ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
224
209
  });
225
210
  return new protocol_http_1.HttpRequest({
226
211
  protocol,
@@ -241,29 +226,23 @@ const serializeAws_restJson1CreateGraphqlApiCommand = async (input, context) =>
241
226
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/apis";
242
227
  let body;
243
228
  body = JSON.stringify({
244
- ...(input.additionalAuthenticationProviders !== undefined &&
245
- input.additionalAuthenticationProviders !== null && {
229
+ ...(input.additionalAuthenticationProviders != null && {
246
230
  additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders(input.additionalAuthenticationProviders, context),
247
231
  }),
248
- ...(input.authenticationType !== undefined &&
249
- input.authenticationType !== null && { authenticationType: input.authenticationType }),
250
- ...(input.lambdaAuthorizerConfig !== undefined &&
251
- input.lambdaAuthorizerConfig !== null && {
232
+ ...(input.authenticationType != null && { authenticationType: input.authenticationType }),
233
+ ...(input.lambdaAuthorizerConfig != null && {
252
234
  lambdaAuthorizerConfig: serializeAws_restJson1LambdaAuthorizerConfig(input.lambdaAuthorizerConfig, context),
253
235
  }),
254
- ...(input.logConfig !== undefined &&
255
- input.logConfig !== null && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }),
256
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
257
- ...(input.openIDConnectConfig !== undefined &&
258
- input.openIDConnectConfig !== null && {
236
+ ...(input.logConfig != null && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }),
237
+ ...(input.name != null && { name: input.name }),
238
+ ...(input.openIDConnectConfig != null && {
259
239
  openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context),
260
240
  }),
261
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
262
- ...(input.userPoolConfig !== undefined &&
263
- input.userPoolConfig !== null && {
241
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
242
+ ...(input.userPoolConfig != null && {
264
243
  userPoolConfig: serializeAws_restJson1UserPoolConfig(input.userPoolConfig, context),
265
244
  }),
266
- ...(input.xrayEnabled !== undefined && input.xrayEnabled !== null && { xrayEnabled: input.xrayEnabled }),
245
+ ...(input.xrayEnabled != null && { xrayEnabled: input.xrayEnabled }),
267
246
  });
268
247
  return new protocol_http_1.HttpRequest({
269
248
  protocol,
@@ -305,25 +284,19 @@ const serializeAws_restJson1CreateResolverCommand = async (input, context) => {
305
284
  }
306
285
  let body;
307
286
  body = JSON.stringify({
308
- ...(input.cachingConfig !== undefined &&
309
- input.cachingConfig !== null && {
287
+ ...(input.cachingConfig != null && {
310
288
  cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context),
311
289
  }),
312
- ...(input.dataSourceName !== undefined &&
313
- input.dataSourceName !== null && { dataSourceName: input.dataSourceName }),
314
- ...(input.fieldName !== undefined && input.fieldName !== null && { fieldName: input.fieldName }),
315
- ...(input.kind !== undefined && input.kind !== null && { kind: input.kind }),
316
- ...(input.maxBatchSize !== undefined && input.maxBatchSize !== null && { maxBatchSize: input.maxBatchSize }),
317
- ...(input.pipelineConfig !== undefined &&
318
- input.pipelineConfig !== null && {
290
+ ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
291
+ ...(input.fieldName != null && { fieldName: input.fieldName }),
292
+ ...(input.kind != null && { kind: input.kind }),
293
+ ...(input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize }),
294
+ ...(input.pipelineConfig != null && {
319
295
  pipelineConfig: serializeAws_restJson1PipelineConfig(input.pipelineConfig, context),
320
296
  }),
321
- ...(input.requestMappingTemplate !== undefined &&
322
- input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }),
323
- ...(input.responseMappingTemplate !== undefined &&
324
- input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }),
325
- ...(input.syncConfig !== undefined &&
326
- input.syncConfig !== null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
297
+ ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
298
+ ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
299
+ ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
327
300
  });
328
301
  return new protocol_http_1.HttpRequest({
329
302
  protocol,
@@ -354,8 +327,8 @@ const serializeAws_restJson1CreateTypeCommand = async (input, context) => {
354
327
  }
355
328
  let body;
356
329
  body = JSON.stringify({
357
- ...(input.definition !== undefined && input.definition !== null && { definition: input.definition }),
358
- ...(input.format !== undefined && input.format !== null && { format: input.format }),
330
+ ...(input.definition != null && { definition: input.definition }),
331
+ ...(input.format != null && { format: input.format }),
359
332
  });
360
333
  return new protocol_http_1.HttpRequest({
361
334
  protocol,
@@ -469,7 +442,7 @@ exports.serializeAws_restJson1DeleteDataSourceCommand = serializeAws_restJson1De
469
442
  const serializeAws_restJson1DeleteDomainNameCommand = async (input, context) => {
470
443
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
471
444
  const headers = {};
472
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames/{domainName}";
445
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domainnames/{domainName}";
473
446
  if (input.domainName !== undefined) {
474
447
  const labelValue = input.domainName;
475
448
  if (labelValue.length <= 0) {
@@ -640,7 +613,8 @@ exports.serializeAws_restJson1DeleteTypeCommand = serializeAws_restJson1DeleteTy
640
613
  const serializeAws_restJson1DisassociateApiCommand = async (input, context) => {
641
614
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
642
615
  const headers = {};
643
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames/{domainName}/apiassociation";
616
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
617
+ "/v1/domainnames/{domainName}/apiassociation";
644
618
  if (input.domainName !== undefined) {
645
619
  const labelValue = input.domainName;
646
620
  if (labelValue.length <= 0) {
@@ -692,7 +666,8 @@ exports.serializeAws_restJson1FlushApiCacheCommand = serializeAws_restJson1Flush
692
666
  const serializeAws_restJson1GetApiAssociationCommand = async (input, context) => {
693
667
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
694
668
  const headers = {};
695
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames/{domainName}/apiassociation";
669
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
670
+ "/v1/domainnames/{domainName}/apiassociation";
696
671
  if (input.domainName !== undefined) {
697
672
  const labelValue = input.domainName;
698
673
  if (labelValue.length <= 0) {
@@ -780,7 +755,7 @@ exports.serializeAws_restJson1GetDataSourceCommand = serializeAws_restJson1GetDa
780
755
  const serializeAws_restJson1GetDomainNameCommand = async (input, context) => {
781
756
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
782
757
  const headers = {};
783
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames/{domainName}";
758
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domainnames/{domainName}";
784
759
  if (input.domainName !== undefined) {
785
760
  const labelValue = input.domainName;
786
761
  if (labelValue.length <= 0) {
@@ -1074,7 +1049,7 @@ exports.serializeAws_restJson1ListDataSourcesCommand = serializeAws_restJson1Lis
1074
1049
  const serializeAws_restJson1ListDomainNamesCommand = async (input, context) => {
1075
1050
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1076
1051
  const headers = {};
1077
- const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames";
1052
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domainnames";
1078
1053
  const query = {
1079
1054
  ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
1080
1055
  ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
@@ -1304,8 +1279,7 @@ const serializeAws_restJson1StartSchemaCreationCommand = async (input, context)
1304
1279
  }
1305
1280
  let body;
1306
1281
  body = JSON.stringify({
1307
- ...(input.definition !== undefined &&
1308
- input.definition !== null && { definition: context.base64Encoder(input.definition) }),
1282
+ ...(input.definition != null && { definition: context.base64Encoder(input.definition) }),
1309
1283
  });
1310
1284
  return new protocol_http_1.HttpRequest({
1311
1285
  protocol,
@@ -1336,7 +1310,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
1336
1310
  }
1337
1311
  let body;
1338
1312
  body = JSON.stringify({
1339
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
1313
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
1340
1314
  });
1341
1315
  return new protocol_http_1.HttpRequest({
1342
1316
  protocol,
@@ -1397,10 +1371,9 @@ const serializeAws_restJson1UpdateApiCacheCommand = async (input, context) => {
1397
1371
  }
1398
1372
  let body;
1399
1373
  body = JSON.stringify({
1400
- ...(input.apiCachingBehavior !== undefined &&
1401
- input.apiCachingBehavior !== null && { apiCachingBehavior: input.apiCachingBehavior }),
1402
- ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }),
1403
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
1374
+ ...(input.apiCachingBehavior != null && { apiCachingBehavior: input.apiCachingBehavior }),
1375
+ ...(input.ttl != null && { ttl: input.ttl }),
1376
+ ...(input.type != null && { type: input.type }),
1404
1377
  });
1405
1378
  return new protocol_http_1.HttpRequest({
1406
1379
  protocol,
@@ -1441,8 +1414,8 @@ const serializeAws_restJson1UpdateApiKeyCommand = async (input, context) => {
1441
1414
  }
1442
1415
  let body;
1443
1416
  body = JSON.stringify({
1444
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
1445
- ...(input.expires !== undefined && input.expires !== null && { expires: input.expires }),
1417
+ ...(input.description != null && { description: input.description }),
1418
+ ...(input.expires != null && { expires: input.expires }),
1446
1419
  });
1447
1420
  return new protocol_http_1.HttpRequest({
1448
1421
  protocol,
@@ -1483,34 +1456,27 @@ const serializeAws_restJson1UpdateDataSourceCommand = async (input, context) =>
1483
1456
  }
1484
1457
  let body;
1485
1458
  body = JSON.stringify({
1486
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
1487
- ...(input.dynamodbConfig !== undefined &&
1488
- input.dynamodbConfig !== null && {
1459
+ ...(input.description != null && { description: input.description }),
1460
+ ...(input.dynamodbConfig != null && {
1489
1461
  dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context),
1490
1462
  }),
1491
- ...(input.elasticsearchConfig !== undefined &&
1492
- input.elasticsearchConfig !== null && {
1463
+ ...(input.elasticsearchConfig != null && {
1493
1464
  elasticsearchConfig: serializeAws_restJson1ElasticsearchDataSourceConfig(input.elasticsearchConfig, context),
1494
1465
  }),
1495
- ...(input.httpConfig !== undefined &&
1496
- input.httpConfig !== null && {
1466
+ ...(input.httpConfig != null && {
1497
1467
  httpConfig: serializeAws_restJson1HttpDataSourceConfig(input.httpConfig, context),
1498
1468
  }),
1499
- ...(input.lambdaConfig !== undefined &&
1500
- input.lambdaConfig !== null && {
1469
+ ...(input.lambdaConfig != null && {
1501
1470
  lambdaConfig: serializeAws_restJson1LambdaDataSourceConfig(input.lambdaConfig, context),
1502
1471
  }),
1503
- ...(input.openSearchServiceConfig !== undefined &&
1504
- input.openSearchServiceConfig !== null && {
1472
+ ...(input.openSearchServiceConfig != null && {
1505
1473
  openSearchServiceConfig: serializeAws_restJson1OpenSearchServiceDataSourceConfig(input.openSearchServiceConfig, context),
1506
1474
  }),
1507
- ...(input.relationalDatabaseConfig !== undefined &&
1508
- input.relationalDatabaseConfig !== null && {
1475
+ ...(input.relationalDatabaseConfig != null && {
1509
1476
  relationalDatabaseConfig: serializeAws_restJson1RelationalDatabaseDataSourceConfig(input.relationalDatabaseConfig, context),
1510
1477
  }),
1511
- ...(input.serviceRoleArn !== undefined &&
1512
- input.serviceRoleArn !== null && { serviceRoleArn: input.serviceRoleArn }),
1513
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
1478
+ ...(input.serviceRoleArn != null && { serviceRoleArn: input.serviceRoleArn }),
1479
+ ...(input.type != null && { type: input.type }),
1514
1480
  });
1515
1481
  return new protocol_http_1.HttpRequest({
1516
1482
  protocol,
@@ -1528,7 +1494,7 @@ const serializeAws_restJson1UpdateDomainNameCommand = async (input, context) =>
1528
1494
  const headers = {
1529
1495
  "content-type": "application/json",
1530
1496
  };
1531
- let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/domainnames/{domainName}";
1497
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domainnames/{domainName}";
1532
1498
  if (input.domainName !== undefined) {
1533
1499
  const labelValue = input.domainName;
1534
1500
  if (labelValue.length <= 0) {
@@ -1541,7 +1507,7 @@ const serializeAws_restJson1UpdateDomainNameCommand = async (input, context) =>
1541
1507
  }
1542
1508
  let body;
1543
1509
  body = JSON.stringify({
1544
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
1510
+ ...(input.description != null && { description: input.description }),
1545
1511
  });
1546
1512
  return new protocol_http_1.HttpRequest({
1547
1513
  protocol,
@@ -1582,19 +1548,14 @@ const serializeAws_restJson1UpdateFunctionCommand = async (input, context) => {
1582
1548
  }
1583
1549
  let body;
1584
1550
  body = JSON.stringify({
1585
- ...(input.dataSourceName !== undefined &&
1586
- input.dataSourceName !== null && { dataSourceName: input.dataSourceName }),
1587
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
1588
- ...(input.functionVersion !== undefined &&
1589
- input.functionVersion !== null && { functionVersion: input.functionVersion }),
1590
- ...(input.maxBatchSize !== undefined && input.maxBatchSize !== null && { maxBatchSize: input.maxBatchSize }),
1591
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
1592
- ...(input.requestMappingTemplate !== undefined &&
1593
- input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }),
1594
- ...(input.responseMappingTemplate !== undefined &&
1595
- input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }),
1596
- ...(input.syncConfig !== undefined &&
1597
- input.syncConfig !== null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
1551
+ ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
1552
+ ...(input.description != null && { description: input.description }),
1553
+ ...(input.functionVersion != null && { functionVersion: input.functionVersion }),
1554
+ ...(input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize }),
1555
+ ...(input.name != null && { name: input.name }),
1556
+ ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
1557
+ ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
1558
+ ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
1598
1559
  });
1599
1560
  return new protocol_http_1.HttpRequest({
1600
1561
  protocol,
@@ -1625,28 +1586,22 @@ const serializeAws_restJson1UpdateGraphqlApiCommand = async (input, context) =>
1625
1586
  }
1626
1587
  let body;
1627
1588
  body = JSON.stringify({
1628
- ...(input.additionalAuthenticationProviders !== undefined &&
1629
- input.additionalAuthenticationProviders !== null && {
1589
+ ...(input.additionalAuthenticationProviders != null && {
1630
1590
  additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders(input.additionalAuthenticationProviders, context),
1631
1591
  }),
1632
- ...(input.authenticationType !== undefined &&
1633
- input.authenticationType !== null && { authenticationType: input.authenticationType }),
1634
- ...(input.lambdaAuthorizerConfig !== undefined &&
1635
- input.lambdaAuthorizerConfig !== null && {
1592
+ ...(input.authenticationType != null && { authenticationType: input.authenticationType }),
1593
+ ...(input.lambdaAuthorizerConfig != null && {
1636
1594
  lambdaAuthorizerConfig: serializeAws_restJson1LambdaAuthorizerConfig(input.lambdaAuthorizerConfig, context),
1637
1595
  }),
1638
- ...(input.logConfig !== undefined &&
1639
- input.logConfig !== null && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }),
1640
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
1641
- ...(input.openIDConnectConfig !== undefined &&
1642
- input.openIDConnectConfig !== null && {
1596
+ ...(input.logConfig != null && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }),
1597
+ ...(input.name != null && { name: input.name }),
1598
+ ...(input.openIDConnectConfig != null && {
1643
1599
  openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context),
1644
1600
  }),
1645
- ...(input.userPoolConfig !== undefined &&
1646
- input.userPoolConfig !== null && {
1601
+ ...(input.userPoolConfig != null && {
1647
1602
  userPoolConfig: serializeAws_restJson1UserPoolConfig(input.userPoolConfig, context),
1648
1603
  }),
1649
- ...(input.xrayEnabled !== undefined && input.xrayEnabled !== null && { xrayEnabled: input.xrayEnabled }),
1604
+ ...(input.xrayEnabled != null && { xrayEnabled: input.xrayEnabled }),
1650
1605
  });
1651
1606
  return new protocol_http_1.HttpRequest({
1652
1607
  protocol,
@@ -1698,24 +1653,18 @@ const serializeAws_restJson1UpdateResolverCommand = async (input, context) => {
1698
1653
  }
1699
1654
  let body;
1700
1655
  body = JSON.stringify({
1701
- ...(input.cachingConfig !== undefined &&
1702
- input.cachingConfig !== null && {
1656
+ ...(input.cachingConfig != null && {
1703
1657
  cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context),
1704
1658
  }),
1705
- ...(input.dataSourceName !== undefined &&
1706
- input.dataSourceName !== null && { dataSourceName: input.dataSourceName }),
1707
- ...(input.kind !== undefined && input.kind !== null && { kind: input.kind }),
1708
- ...(input.maxBatchSize !== undefined && input.maxBatchSize !== null && { maxBatchSize: input.maxBatchSize }),
1709
- ...(input.pipelineConfig !== undefined &&
1710
- input.pipelineConfig !== null && {
1659
+ ...(input.dataSourceName != null && { dataSourceName: input.dataSourceName }),
1660
+ ...(input.kind != null && { kind: input.kind }),
1661
+ ...(input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize }),
1662
+ ...(input.pipelineConfig != null && {
1711
1663
  pipelineConfig: serializeAws_restJson1PipelineConfig(input.pipelineConfig, context),
1712
1664
  }),
1713
- ...(input.requestMappingTemplate !== undefined &&
1714
- input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }),
1715
- ...(input.responseMappingTemplate !== undefined &&
1716
- input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }),
1717
- ...(input.syncConfig !== undefined &&
1718
- input.syncConfig !== null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
1665
+ ...(input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate }),
1666
+ ...(input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate }),
1667
+ ...(input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }),
1719
1668
  });
1720
1669
  return new protocol_http_1.HttpRequest({
1721
1670
  protocol,
@@ -1756,8 +1705,8 @@ const serializeAws_restJson1UpdateTypeCommand = async (input, context) => {
1756
1705
  }
1757
1706
  let body;
1758
1707
  body = JSON.stringify({
1759
- ...(input.definition !== undefined && input.definition !== null && { definition: input.definition }),
1760
- ...(input.format !== undefined && input.format !== null && { format: input.format }),
1708
+ ...(input.definition != null && { definition: input.definition }),
1709
+ ...(input.format != null && { format: input.format }),
1761
1710
  });
1762
1711
  return new protocol_http_1.HttpRequest({
1763
1712
  protocol,
@@ -1791,8 +1740,7 @@ const deserializeAws_restJson1AssociateApiCommandError = async (output, context)
1791
1740
  body: await parseBody(output.body, context),
1792
1741
  };
1793
1742
  let response;
1794
- let errorCode = "UnknownError";
1795
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1743
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1796
1744
  switch (errorCode) {
1797
1745
  case "AccessDeniedException":
1798
1746
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -1808,10 +1756,12 @@ const deserializeAws_restJson1AssociateApiCommandError = async (output, context)
1808
1756
  throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1809
1757
  default:
1810
1758
  const parsedBody = parsedOutput.body;
1759
+ const $metadata = deserializeMetadata(output);
1760
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1811
1761
  response = new AppSyncServiceException_1.AppSyncServiceException({
1812
- name: parsedBody.code || parsedBody.Code || errorCode,
1762
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1813
1763
  $fault: "client",
1814
- $metadata: deserializeMetadata(output),
1764
+ $metadata,
1815
1765
  });
1816
1766
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1817
1767
  }
@@ -1837,8 +1787,7 @@ const deserializeAws_restJson1CreateApiCacheCommandError = async (output, contex
1837
1787
  body: await parseBody(output.body, context),
1838
1788
  };
1839
1789
  let response;
1840
- let errorCode = "UnknownError";
1841
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1790
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1842
1791
  switch (errorCode) {
1843
1792
  case "BadRequestException":
1844
1793
  case "com.amazonaws.appsync#BadRequestException":
@@ -1857,10 +1806,12 @@ const deserializeAws_restJson1CreateApiCacheCommandError = async (output, contex
1857
1806
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1858
1807
  default:
1859
1808
  const parsedBody = parsedOutput.body;
1809
+ const $metadata = deserializeMetadata(output);
1810
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1860
1811
  response = new AppSyncServiceException_1.AppSyncServiceException({
1861
- name: parsedBody.code || parsedBody.Code || errorCode,
1812
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1862
1813
  $fault: "client",
1863
- $metadata: deserializeMetadata(output),
1814
+ $metadata,
1864
1815
  });
1865
1816
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1866
1817
  }
@@ -1886,8 +1837,7 @@ const deserializeAws_restJson1CreateApiKeyCommandError = async (output, context)
1886
1837
  body: await parseBody(output.body, context),
1887
1838
  };
1888
1839
  let response;
1889
- let errorCode = "UnknownError";
1890
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1840
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1891
1841
  switch (errorCode) {
1892
1842
  case "ApiKeyLimitExceededException":
1893
1843
  case "com.amazonaws.appsync#ApiKeyLimitExceededException":
@@ -1912,10 +1862,12 @@ const deserializeAws_restJson1CreateApiKeyCommandError = async (output, context)
1912
1862
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1913
1863
  default:
1914
1864
  const parsedBody = parsedOutput.body;
1865
+ const $metadata = deserializeMetadata(output);
1866
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1915
1867
  response = new AppSyncServiceException_1.AppSyncServiceException({
1916
- name: parsedBody.code || parsedBody.Code || errorCode,
1868
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1917
1869
  $fault: "client",
1918
- $metadata: deserializeMetadata(output),
1870
+ $metadata,
1919
1871
  });
1920
1872
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1921
1873
  }
@@ -1941,8 +1893,7 @@ const deserializeAws_restJson1CreateDataSourceCommandError = async (output, cont
1941
1893
  body: await parseBody(output.body, context),
1942
1894
  };
1943
1895
  let response;
1944
- let errorCode = "UnknownError";
1945
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1896
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1946
1897
  switch (errorCode) {
1947
1898
  case "BadRequestException":
1948
1899
  case "com.amazonaws.appsync#BadRequestException":
@@ -1961,10 +1912,12 @@ const deserializeAws_restJson1CreateDataSourceCommandError = async (output, cont
1961
1912
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1962
1913
  default:
1963
1914
  const parsedBody = parsedOutput.body;
1915
+ const $metadata = deserializeMetadata(output);
1916
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1964
1917
  response = new AppSyncServiceException_1.AppSyncServiceException({
1965
- name: parsedBody.code || parsedBody.Code || errorCode,
1918
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1966
1919
  $fault: "client",
1967
- $metadata: deserializeMetadata(output),
1920
+ $metadata,
1968
1921
  });
1969
1922
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1970
1923
  }
@@ -1990,8 +1943,7 @@ const deserializeAws_restJson1CreateDomainNameCommandError = async (output, cont
1990
1943
  body: await parseBody(output.body, context),
1991
1944
  };
1992
1945
  let response;
1993
- let errorCode = "UnknownError";
1994
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1946
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1995
1947
  switch (errorCode) {
1996
1948
  case "AccessDeniedException":
1997
1949
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2004,10 +1956,12 @@ const deserializeAws_restJson1CreateDomainNameCommandError = async (output, cont
2004
1956
  throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2005
1957
  default:
2006
1958
  const parsedBody = parsedOutput.body;
1959
+ const $metadata = deserializeMetadata(output);
1960
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2007
1961
  response = new AppSyncServiceException_1.AppSyncServiceException({
2008
- name: parsedBody.code || parsedBody.Code || errorCode,
1962
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2009
1963
  $fault: "client",
2010
- $metadata: deserializeMetadata(output),
1964
+ $metadata,
2011
1965
  });
2012
1966
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2013
1967
  }
@@ -2033,8 +1987,7 @@ const deserializeAws_restJson1CreateFunctionCommandError = async (output, contex
2033
1987
  body: await parseBody(output.body, context),
2034
1988
  };
2035
1989
  let response;
2036
- let errorCode = "UnknownError";
2037
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1990
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2038
1991
  switch (errorCode) {
2039
1992
  case "ConcurrentModificationException":
2040
1993
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -2050,10 +2003,12 @@ const deserializeAws_restJson1CreateFunctionCommandError = async (output, contex
2050
2003
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2051
2004
  default:
2052
2005
  const parsedBody = parsedOutput.body;
2006
+ const $metadata = deserializeMetadata(output);
2007
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2053
2008
  response = new AppSyncServiceException_1.AppSyncServiceException({
2054
- name: parsedBody.code || parsedBody.Code || errorCode,
2009
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2055
2010
  $fault: "client",
2056
- $metadata: deserializeMetadata(output),
2011
+ $metadata,
2057
2012
  });
2058
2013
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2059
2014
  }
@@ -2079,8 +2034,7 @@ const deserializeAws_restJson1CreateGraphqlApiCommandError = async (output, cont
2079
2034
  body: await parseBody(output.body, context),
2080
2035
  };
2081
2036
  let response;
2082
- let errorCode = "UnknownError";
2083
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2037
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2084
2038
  switch (errorCode) {
2085
2039
  case "ApiLimitExceededException":
2086
2040
  case "com.amazonaws.appsync#ApiLimitExceededException":
@@ -2102,10 +2056,12 @@ const deserializeAws_restJson1CreateGraphqlApiCommandError = async (output, cont
2102
2056
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2103
2057
  default:
2104
2058
  const parsedBody = parsedOutput.body;
2059
+ const $metadata = deserializeMetadata(output);
2060
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2105
2061
  response = new AppSyncServiceException_1.AppSyncServiceException({
2106
- name: parsedBody.code || parsedBody.Code || errorCode,
2062
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2107
2063
  $fault: "client",
2108
- $metadata: deserializeMetadata(output),
2064
+ $metadata,
2109
2065
  });
2110
2066
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2111
2067
  }
@@ -2131,8 +2087,7 @@ const deserializeAws_restJson1CreateResolverCommandError = async (output, contex
2131
2087
  body: await parseBody(output.body, context),
2132
2088
  };
2133
2089
  let response;
2134
- let errorCode = "UnknownError";
2135
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2090
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2136
2091
  switch (errorCode) {
2137
2092
  case "ConcurrentModificationException":
2138
2093
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -2148,10 +2103,12 @@ const deserializeAws_restJson1CreateResolverCommandError = async (output, contex
2148
2103
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2149
2104
  default:
2150
2105
  const parsedBody = parsedOutput.body;
2106
+ const $metadata = deserializeMetadata(output);
2107
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2151
2108
  response = new AppSyncServiceException_1.AppSyncServiceException({
2152
- name: parsedBody.code || parsedBody.Code || errorCode,
2109
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2153
2110
  $fault: "client",
2154
- $metadata: deserializeMetadata(output),
2111
+ $metadata,
2155
2112
  });
2156
2113
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2157
2114
  }
@@ -2177,8 +2134,7 @@ const deserializeAws_restJson1CreateTypeCommandError = async (output, context) =
2177
2134
  body: await parseBody(output.body, context),
2178
2135
  };
2179
2136
  let response;
2180
- let errorCode = "UnknownError";
2181
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2137
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2182
2138
  switch (errorCode) {
2183
2139
  case "BadRequestException":
2184
2140
  case "com.amazonaws.appsync#BadRequestException":
@@ -2197,10 +2153,12 @@ const deserializeAws_restJson1CreateTypeCommandError = async (output, context) =
2197
2153
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2198
2154
  default:
2199
2155
  const parsedBody = parsedOutput.body;
2156
+ const $metadata = deserializeMetadata(output);
2157
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2200
2158
  response = new AppSyncServiceException_1.AppSyncServiceException({
2201
- name: parsedBody.code || parsedBody.Code || errorCode,
2159
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2202
2160
  $fault: "client",
2203
- $metadata: deserializeMetadata(output),
2161
+ $metadata,
2204
2162
  });
2205
2163
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2206
2164
  }
@@ -2222,8 +2180,7 @@ const deserializeAws_restJson1DeleteApiCacheCommandError = async (output, contex
2222
2180
  body: await parseBody(output.body, context),
2223
2181
  };
2224
2182
  let response;
2225
- let errorCode = "UnknownError";
2226
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2183
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2227
2184
  switch (errorCode) {
2228
2185
  case "BadRequestException":
2229
2186
  case "com.amazonaws.appsync#BadRequestException":
@@ -2242,10 +2199,12 @@ const deserializeAws_restJson1DeleteApiCacheCommandError = async (output, contex
2242
2199
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2243
2200
  default:
2244
2201
  const parsedBody = parsedOutput.body;
2202
+ const $metadata = deserializeMetadata(output);
2203
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2245
2204
  response = new AppSyncServiceException_1.AppSyncServiceException({
2246
- name: parsedBody.code || parsedBody.Code || errorCode,
2205
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2247
2206
  $fault: "client",
2248
- $metadata: deserializeMetadata(output),
2207
+ $metadata,
2249
2208
  });
2250
2209
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2251
2210
  }
@@ -2267,8 +2226,7 @@ const deserializeAws_restJson1DeleteApiKeyCommandError = async (output, context)
2267
2226
  body: await parseBody(output.body, context),
2268
2227
  };
2269
2228
  let response;
2270
- let errorCode = "UnknownError";
2271
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2229
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2272
2230
  switch (errorCode) {
2273
2231
  case "BadRequestException":
2274
2232
  case "com.amazonaws.appsync#BadRequestException":
@@ -2284,10 +2242,12 @@ const deserializeAws_restJson1DeleteApiKeyCommandError = async (output, context)
2284
2242
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2285
2243
  default:
2286
2244
  const parsedBody = parsedOutput.body;
2245
+ const $metadata = deserializeMetadata(output);
2246
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2287
2247
  response = new AppSyncServiceException_1.AppSyncServiceException({
2288
- name: parsedBody.code || parsedBody.Code || errorCode,
2248
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2289
2249
  $fault: "client",
2290
- $metadata: deserializeMetadata(output),
2250
+ $metadata,
2291
2251
  });
2292
2252
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2293
2253
  }
@@ -2309,8 +2269,7 @@ const deserializeAws_restJson1DeleteDataSourceCommandError = async (output, cont
2309
2269
  body: await parseBody(output.body, context),
2310
2270
  };
2311
2271
  let response;
2312
- let errorCode = "UnknownError";
2313
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2272
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2314
2273
  switch (errorCode) {
2315
2274
  case "BadRequestException":
2316
2275
  case "com.amazonaws.appsync#BadRequestException":
@@ -2329,10 +2288,12 @@ const deserializeAws_restJson1DeleteDataSourceCommandError = async (output, cont
2329
2288
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2330
2289
  default:
2331
2290
  const parsedBody = parsedOutput.body;
2291
+ const $metadata = deserializeMetadata(output);
2292
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2332
2293
  response = new AppSyncServiceException_1.AppSyncServiceException({
2333
- name: parsedBody.code || parsedBody.Code || errorCode,
2294
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2334
2295
  $fault: "client",
2335
- $metadata: deserializeMetadata(output),
2296
+ $metadata,
2336
2297
  });
2337
2298
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2338
2299
  }
@@ -2354,8 +2315,7 @@ const deserializeAws_restJson1DeleteDomainNameCommandError = async (output, cont
2354
2315
  body: await parseBody(output.body, context),
2355
2316
  };
2356
2317
  let response;
2357
- let errorCode = "UnknownError";
2358
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2318
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2359
2319
  switch (errorCode) {
2360
2320
  case "AccessDeniedException":
2361
2321
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2374,10 +2334,12 @@ const deserializeAws_restJson1DeleteDomainNameCommandError = async (output, cont
2374
2334
  throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2375
2335
  default:
2376
2336
  const parsedBody = parsedOutput.body;
2337
+ const $metadata = deserializeMetadata(output);
2338
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2377
2339
  response = new AppSyncServiceException_1.AppSyncServiceException({
2378
- name: parsedBody.code || parsedBody.Code || errorCode,
2340
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2379
2341
  $fault: "client",
2380
- $metadata: deserializeMetadata(output),
2342
+ $metadata,
2381
2343
  });
2382
2344
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2383
2345
  }
@@ -2399,8 +2361,7 @@ const deserializeAws_restJson1DeleteFunctionCommandError = async (output, contex
2399
2361
  body: await parseBody(output.body, context),
2400
2362
  };
2401
2363
  let response;
2402
- let errorCode = "UnknownError";
2403
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2364
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2404
2365
  switch (errorCode) {
2405
2366
  case "ConcurrentModificationException":
2406
2367
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -2416,10 +2377,12 @@ const deserializeAws_restJson1DeleteFunctionCommandError = async (output, contex
2416
2377
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2417
2378
  default:
2418
2379
  const parsedBody = parsedOutput.body;
2380
+ const $metadata = deserializeMetadata(output);
2381
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2419
2382
  response = new AppSyncServiceException_1.AppSyncServiceException({
2420
- name: parsedBody.code || parsedBody.Code || errorCode,
2383
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2421
2384
  $fault: "client",
2422
- $metadata: deserializeMetadata(output),
2385
+ $metadata,
2423
2386
  });
2424
2387
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2425
2388
  }
@@ -2441,8 +2404,7 @@ const deserializeAws_restJson1DeleteGraphqlApiCommandError = async (output, cont
2441
2404
  body: await parseBody(output.body, context),
2442
2405
  };
2443
2406
  let response;
2444
- let errorCode = "UnknownError";
2445
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2407
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2446
2408
  switch (errorCode) {
2447
2409
  case "AccessDeniedException":
2448
2410
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2464,10 +2426,12 @@ const deserializeAws_restJson1DeleteGraphqlApiCommandError = async (output, cont
2464
2426
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2465
2427
  default:
2466
2428
  const parsedBody = parsedOutput.body;
2429
+ const $metadata = deserializeMetadata(output);
2430
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2467
2431
  response = new AppSyncServiceException_1.AppSyncServiceException({
2468
- name: parsedBody.code || parsedBody.Code || errorCode,
2432
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2469
2433
  $fault: "client",
2470
- $metadata: deserializeMetadata(output),
2434
+ $metadata,
2471
2435
  });
2472
2436
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2473
2437
  }
@@ -2489,8 +2453,7 @@ const deserializeAws_restJson1DeleteResolverCommandError = async (output, contex
2489
2453
  body: await parseBody(output.body, context),
2490
2454
  };
2491
2455
  let response;
2492
- let errorCode = "UnknownError";
2493
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2456
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2494
2457
  switch (errorCode) {
2495
2458
  case "ConcurrentModificationException":
2496
2459
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -2506,10 +2469,12 @@ const deserializeAws_restJson1DeleteResolverCommandError = async (output, contex
2506
2469
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2507
2470
  default:
2508
2471
  const parsedBody = parsedOutput.body;
2472
+ const $metadata = deserializeMetadata(output);
2473
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2509
2474
  response = new AppSyncServiceException_1.AppSyncServiceException({
2510
- name: parsedBody.code || parsedBody.Code || errorCode,
2475
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2511
2476
  $fault: "client",
2512
- $metadata: deserializeMetadata(output),
2477
+ $metadata,
2513
2478
  });
2514
2479
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2515
2480
  }
@@ -2531,8 +2496,7 @@ const deserializeAws_restJson1DeleteTypeCommandError = async (output, context) =
2531
2496
  body: await parseBody(output.body, context),
2532
2497
  };
2533
2498
  let response;
2534
- let errorCode = "UnknownError";
2535
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2499
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2536
2500
  switch (errorCode) {
2537
2501
  case "BadRequestException":
2538
2502
  case "com.amazonaws.appsync#BadRequestException":
@@ -2551,10 +2515,12 @@ const deserializeAws_restJson1DeleteTypeCommandError = async (output, context) =
2551
2515
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2552
2516
  default:
2553
2517
  const parsedBody = parsedOutput.body;
2518
+ const $metadata = deserializeMetadata(output);
2519
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2554
2520
  response = new AppSyncServiceException_1.AppSyncServiceException({
2555
- name: parsedBody.code || parsedBody.Code || errorCode,
2521
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2556
2522
  $fault: "client",
2557
- $metadata: deserializeMetadata(output),
2523
+ $metadata,
2558
2524
  });
2559
2525
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2560
2526
  }
@@ -2576,8 +2542,7 @@ const deserializeAws_restJson1DisassociateApiCommandError = async (output, conte
2576
2542
  body: await parseBody(output.body, context),
2577
2543
  };
2578
2544
  let response;
2579
- let errorCode = "UnknownError";
2580
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2545
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2581
2546
  switch (errorCode) {
2582
2547
  case "AccessDeniedException":
2583
2548
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2596,10 +2561,12 @@ const deserializeAws_restJson1DisassociateApiCommandError = async (output, conte
2596
2561
  throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2597
2562
  default:
2598
2563
  const parsedBody = parsedOutput.body;
2564
+ const $metadata = deserializeMetadata(output);
2565
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2599
2566
  response = new AppSyncServiceException_1.AppSyncServiceException({
2600
- name: parsedBody.code || parsedBody.Code || errorCode,
2567
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2601
2568
  $fault: "client",
2602
- $metadata: deserializeMetadata(output),
2569
+ $metadata,
2603
2570
  });
2604
2571
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2605
2572
  }
@@ -2621,8 +2588,7 @@ const deserializeAws_restJson1FlushApiCacheCommandError = async (output, context
2621
2588
  body: await parseBody(output.body, context),
2622
2589
  };
2623
2590
  let response;
2624
- let errorCode = "UnknownError";
2625
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2591
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2626
2592
  switch (errorCode) {
2627
2593
  case "BadRequestException":
2628
2594
  case "com.amazonaws.appsync#BadRequestException":
@@ -2641,10 +2607,12 @@ const deserializeAws_restJson1FlushApiCacheCommandError = async (output, context
2641
2607
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2642
2608
  default:
2643
2609
  const parsedBody = parsedOutput.body;
2610
+ const $metadata = deserializeMetadata(output);
2611
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2644
2612
  response = new AppSyncServiceException_1.AppSyncServiceException({
2645
- name: parsedBody.code || parsedBody.Code || errorCode,
2613
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2646
2614
  $fault: "client",
2647
- $metadata: deserializeMetadata(output),
2615
+ $metadata,
2648
2616
  });
2649
2617
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2650
2618
  }
@@ -2670,8 +2638,7 @@ const deserializeAws_restJson1GetApiAssociationCommandError = async (output, con
2670
2638
  body: await parseBody(output.body, context),
2671
2639
  };
2672
2640
  let response;
2673
- let errorCode = "UnknownError";
2674
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2641
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2675
2642
  switch (errorCode) {
2676
2643
  case "AccessDeniedException":
2677
2644
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2687,10 +2654,12 @@ const deserializeAws_restJson1GetApiAssociationCommandError = async (output, con
2687
2654
  throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2688
2655
  default:
2689
2656
  const parsedBody = parsedOutput.body;
2657
+ const $metadata = deserializeMetadata(output);
2658
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2690
2659
  response = new AppSyncServiceException_1.AppSyncServiceException({
2691
- name: parsedBody.code || parsedBody.Code || errorCode,
2660
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2692
2661
  $fault: "client",
2693
- $metadata: deserializeMetadata(output),
2662
+ $metadata,
2694
2663
  });
2695
2664
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2696
2665
  }
@@ -2716,8 +2685,7 @@ const deserializeAws_restJson1GetApiCacheCommandError = async (output, context)
2716
2685
  body: await parseBody(output.body, context),
2717
2686
  };
2718
2687
  let response;
2719
- let errorCode = "UnknownError";
2720
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2688
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2721
2689
  switch (errorCode) {
2722
2690
  case "BadRequestException":
2723
2691
  case "com.amazonaws.appsync#BadRequestException":
@@ -2736,10 +2704,12 @@ const deserializeAws_restJson1GetApiCacheCommandError = async (output, context)
2736
2704
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2737
2705
  default:
2738
2706
  const parsedBody = parsedOutput.body;
2707
+ const $metadata = deserializeMetadata(output);
2708
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2739
2709
  response = new AppSyncServiceException_1.AppSyncServiceException({
2740
- name: parsedBody.code || parsedBody.Code || errorCode,
2710
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2741
2711
  $fault: "client",
2742
- $metadata: deserializeMetadata(output),
2712
+ $metadata,
2743
2713
  });
2744
2714
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2745
2715
  }
@@ -2765,8 +2735,7 @@ const deserializeAws_restJson1GetDataSourceCommandError = async (output, context
2765
2735
  body: await parseBody(output.body, context),
2766
2736
  };
2767
2737
  let response;
2768
- let errorCode = "UnknownError";
2769
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2738
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2770
2739
  switch (errorCode) {
2771
2740
  case "BadRequestException":
2772
2741
  case "com.amazonaws.appsync#BadRequestException":
@@ -2785,10 +2754,12 @@ const deserializeAws_restJson1GetDataSourceCommandError = async (output, context
2785
2754
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2786
2755
  default:
2787
2756
  const parsedBody = parsedOutput.body;
2757
+ const $metadata = deserializeMetadata(output);
2758
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2788
2759
  response = new AppSyncServiceException_1.AppSyncServiceException({
2789
- name: parsedBody.code || parsedBody.Code || errorCode,
2760
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2790
2761
  $fault: "client",
2791
- $metadata: deserializeMetadata(output),
2762
+ $metadata,
2792
2763
  });
2793
2764
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2794
2765
  }
@@ -2814,8 +2785,7 @@ const deserializeAws_restJson1GetDomainNameCommandError = async (output, context
2814
2785
  body: await parseBody(output.body, context),
2815
2786
  };
2816
2787
  let response;
2817
- let errorCode = "UnknownError";
2818
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2788
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2819
2789
  switch (errorCode) {
2820
2790
  case "AccessDeniedException":
2821
2791
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2831,10 +2801,12 @@ const deserializeAws_restJson1GetDomainNameCommandError = async (output, context
2831
2801
  throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2832
2802
  default:
2833
2803
  const parsedBody = parsedOutput.body;
2804
+ const $metadata = deserializeMetadata(output);
2805
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2834
2806
  response = new AppSyncServiceException_1.AppSyncServiceException({
2835
- name: parsedBody.code || parsedBody.Code || errorCode,
2807
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2836
2808
  $fault: "client",
2837
- $metadata: deserializeMetadata(output),
2809
+ $metadata,
2838
2810
  });
2839
2811
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2840
2812
  }
@@ -2860,8 +2832,7 @@ const deserializeAws_restJson1GetFunctionCommandError = async (output, context)
2860
2832
  body: await parseBody(output.body, context),
2861
2833
  };
2862
2834
  let response;
2863
- let errorCode = "UnknownError";
2864
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2835
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2865
2836
  switch (errorCode) {
2866
2837
  case "ConcurrentModificationException":
2867
2838
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -2874,10 +2845,12 @@ const deserializeAws_restJson1GetFunctionCommandError = async (output, context)
2874
2845
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2875
2846
  default:
2876
2847
  const parsedBody = parsedOutput.body;
2848
+ const $metadata = deserializeMetadata(output);
2849
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2877
2850
  response = new AppSyncServiceException_1.AppSyncServiceException({
2878
- name: parsedBody.code || parsedBody.Code || errorCode,
2851
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2879
2852
  $fault: "client",
2880
- $metadata: deserializeMetadata(output),
2853
+ $metadata,
2881
2854
  });
2882
2855
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2883
2856
  }
@@ -2903,8 +2876,7 @@ const deserializeAws_restJson1GetGraphqlApiCommandError = async (output, context
2903
2876
  body: await parseBody(output.body, context),
2904
2877
  };
2905
2878
  let response;
2906
- let errorCode = "UnknownError";
2907
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2879
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2908
2880
  switch (errorCode) {
2909
2881
  case "AccessDeniedException":
2910
2882
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -2923,10 +2895,12 @@ const deserializeAws_restJson1GetGraphqlApiCommandError = async (output, context
2923
2895
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2924
2896
  default:
2925
2897
  const parsedBody = parsedOutput.body;
2898
+ const $metadata = deserializeMetadata(output);
2899
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2926
2900
  response = new AppSyncServiceException_1.AppSyncServiceException({
2927
- name: parsedBody.code || parsedBody.Code || errorCode,
2901
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2928
2902
  $fault: "client",
2929
- $metadata: deserializeMetadata(output),
2903
+ $metadata,
2930
2904
  });
2931
2905
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2932
2906
  }
@@ -2950,8 +2924,7 @@ const deserializeAws_restJson1GetIntrospectionSchemaCommandError = async (output
2950
2924
  body: await parseBody(output.body, context),
2951
2925
  };
2952
2926
  let response;
2953
- let errorCode = "UnknownError";
2954
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2927
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2955
2928
  switch (errorCode) {
2956
2929
  case "GraphQLSchemaException":
2957
2930
  case "com.amazonaws.appsync#GraphQLSchemaException":
@@ -2967,10 +2940,12 @@ const deserializeAws_restJson1GetIntrospectionSchemaCommandError = async (output
2967
2940
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2968
2941
  default:
2969
2942
  const parsedBody = parsedOutput.body;
2943
+ const $metadata = deserializeMetadata(output);
2944
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2970
2945
  response = new AppSyncServiceException_1.AppSyncServiceException({
2971
- name: parsedBody.code || parsedBody.Code || errorCode,
2946
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2972
2947
  $fault: "client",
2973
- $metadata: deserializeMetadata(output),
2948
+ $metadata,
2974
2949
  });
2975
2950
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2976
2951
  }
@@ -2996,8 +2971,7 @@ const deserializeAws_restJson1GetResolverCommandError = async (output, context)
2996
2971
  body: await parseBody(output.body, context),
2997
2972
  };
2998
2973
  let response;
2999
- let errorCode = "UnknownError";
3000
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2974
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3001
2975
  switch (errorCode) {
3002
2976
  case "ConcurrentModificationException":
3003
2977
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -3010,10 +2984,12 @@ const deserializeAws_restJson1GetResolverCommandError = async (output, context)
3010
2984
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3011
2985
  default:
3012
2986
  const parsedBody = parsedOutput.body;
2987
+ const $metadata = deserializeMetadata(output);
2988
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3013
2989
  response = new AppSyncServiceException_1.AppSyncServiceException({
3014
- name: parsedBody.code || parsedBody.Code || errorCode,
2990
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3015
2991
  $fault: "client",
3016
- $metadata: deserializeMetadata(output),
2992
+ $metadata,
3017
2993
  });
3018
2994
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3019
2995
  }
@@ -3043,8 +3019,7 @@ const deserializeAws_restJson1GetSchemaCreationStatusCommandError = async (outpu
3043
3019
  body: await parseBody(output.body, context),
3044
3020
  };
3045
3021
  let response;
3046
- let errorCode = "UnknownError";
3047
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3022
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3048
3023
  switch (errorCode) {
3049
3024
  case "BadRequestException":
3050
3025
  case "com.amazonaws.appsync#BadRequestException":
@@ -3060,10 +3035,12 @@ const deserializeAws_restJson1GetSchemaCreationStatusCommandError = async (outpu
3060
3035
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3061
3036
  default:
3062
3037
  const parsedBody = parsedOutput.body;
3038
+ const $metadata = deserializeMetadata(output);
3039
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3063
3040
  response = new AppSyncServiceException_1.AppSyncServiceException({
3064
- name: parsedBody.code || parsedBody.Code || errorCode,
3041
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3065
3042
  $fault: "client",
3066
- $metadata: deserializeMetadata(output),
3043
+ $metadata,
3067
3044
  });
3068
3045
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3069
3046
  }
@@ -3089,8 +3066,7 @@ const deserializeAws_restJson1GetTypeCommandError = async (output, context) => {
3089
3066
  body: await parseBody(output.body, context),
3090
3067
  };
3091
3068
  let response;
3092
- let errorCode = "UnknownError";
3093
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3069
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3094
3070
  switch (errorCode) {
3095
3071
  case "BadRequestException":
3096
3072
  case "com.amazonaws.appsync#BadRequestException":
@@ -3109,10 +3085,12 @@ const deserializeAws_restJson1GetTypeCommandError = async (output, context) => {
3109
3085
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3110
3086
  default:
3111
3087
  const parsedBody = parsedOutput.body;
3088
+ const $metadata = deserializeMetadata(output);
3089
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3112
3090
  response = new AppSyncServiceException_1.AppSyncServiceException({
3113
- name: parsedBody.code || parsedBody.Code || errorCode,
3091
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3114
3092
  $fault: "client",
3115
- $metadata: deserializeMetadata(output),
3093
+ $metadata,
3116
3094
  });
3117
3095
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3118
3096
  }
@@ -3142,8 +3120,7 @@ const deserializeAws_restJson1ListApiKeysCommandError = async (output, context)
3142
3120
  body: await parseBody(output.body, context),
3143
3121
  };
3144
3122
  let response;
3145
- let errorCode = "UnknownError";
3146
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3123
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3147
3124
  switch (errorCode) {
3148
3125
  case "BadRequestException":
3149
3126
  case "com.amazonaws.appsync#BadRequestException":
@@ -3159,10 +3136,12 @@ const deserializeAws_restJson1ListApiKeysCommandError = async (output, context)
3159
3136
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3160
3137
  default:
3161
3138
  const parsedBody = parsedOutput.body;
3139
+ const $metadata = deserializeMetadata(output);
3140
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3162
3141
  response = new AppSyncServiceException_1.AppSyncServiceException({
3163
- name: parsedBody.code || parsedBody.Code || errorCode,
3142
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3164
3143
  $fault: "client",
3165
- $metadata: deserializeMetadata(output),
3144
+ $metadata,
3166
3145
  });
3167
3146
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3168
3147
  }
@@ -3192,8 +3171,7 @@ const deserializeAws_restJson1ListDataSourcesCommandError = async (output, conte
3192
3171
  body: await parseBody(output.body, context),
3193
3172
  };
3194
3173
  let response;
3195
- let errorCode = "UnknownError";
3196
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3174
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3197
3175
  switch (errorCode) {
3198
3176
  case "BadRequestException":
3199
3177
  case "com.amazonaws.appsync#BadRequestException":
@@ -3209,10 +3187,12 @@ const deserializeAws_restJson1ListDataSourcesCommandError = async (output, conte
3209
3187
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3210
3188
  default:
3211
3189
  const parsedBody = parsedOutput.body;
3190
+ const $metadata = deserializeMetadata(output);
3191
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3212
3192
  response = new AppSyncServiceException_1.AppSyncServiceException({
3213
- name: parsedBody.code || parsedBody.Code || errorCode,
3193
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3214
3194
  $fault: "client",
3215
- $metadata: deserializeMetadata(output),
3195
+ $metadata,
3216
3196
  });
3217
3197
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3218
3198
  }
@@ -3242,8 +3222,7 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async (output, conte
3242
3222
  body: await parseBody(output.body, context),
3243
3223
  };
3244
3224
  let response;
3245
- let errorCode = "UnknownError";
3246
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3225
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3247
3226
  switch (errorCode) {
3248
3227
  case "AccessDeniedException":
3249
3228
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -3256,10 +3235,12 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async (output, conte
3256
3235
  throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3257
3236
  default:
3258
3237
  const parsedBody = parsedOutput.body;
3238
+ const $metadata = deserializeMetadata(output);
3239
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3259
3240
  response = new AppSyncServiceException_1.AppSyncServiceException({
3260
- name: parsedBody.code || parsedBody.Code || errorCode,
3241
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3261
3242
  $fault: "client",
3262
- $metadata: deserializeMetadata(output),
3243
+ $metadata,
3263
3244
  });
3264
3245
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3265
3246
  }
@@ -3289,8 +3270,7 @@ const deserializeAws_restJson1ListFunctionsCommandError = async (output, context
3289
3270
  body: await parseBody(output.body, context),
3290
3271
  };
3291
3272
  let response;
3292
- let errorCode = "UnknownError";
3293
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3273
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3294
3274
  switch (errorCode) {
3295
3275
  case "BadRequestException":
3296
3276
  case "com.amazonaws.appsync#BadRequestException":
@@ -3306,10 +3286,12 @@ const deserializeAws_restJson1ListFunctionsCommandError = async (output, context
3306
3286
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3307
3287
  default:
3308
3288
  const parsedBody = parsedOutput.body;
3289
+ const $metadata = deserializeMetadata(output);
3290
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3309
3291
  response = new AppSyncServiceException_1.AppSyncServiceException({
3310
- name: parsedBody.code || parsedBody.Code || errorCode,
3292
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3311
3293
  $fault: "client",
3312
- $metadata: deserializeMetadata(output),
3294
+ $metadata,
3313
3295
  });
3314
3296
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3315
3297
  }
@@ -3339,8 +3321,7 @@ const deserializeAws_restJson1ListGraphqlApisCommandError = async (output, conte
3339
3321
  body: await parseBody(output.body, context),
3340
3322
  };
3341
3323
  let response;
3342
- let errorCode = "UnknownError";
3343
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3324
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3344
3325
  switch (errorCode) {
3345
3326
  case "BadRequestException":
3346
3327
  case "com.amazonaws.appsync#BadRequestException":
@@ -3353,10 +3334,12 @@ const deserializeAws_restJson1ListGraphqlApisCommandError = async (output, conte
3353
3334
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3354
3335
  default:
3355
3336
  const parsedBody = parsedOutput.body;
3337
+ const $metadata = deserializeMetadata(output);
3338
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3356
3339
  response = new AppSyncServiceException_1.AppSyncServiceException({
3357
- name: parsedBody.code || parsedBody.Code || errorCode,
3340
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3358
3341
  $fault: "client",
3359
- $metadata: deserializeMetadata(output),
3342
+ $metadata,
3360
3343
  });
3361
3344
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3362
3345
  }
@@ -3386,8 +3369,7 @@ const deserializeAws_restJson1ListResolversCommandError = async (output, context
3386
3369
  body: await parseBody(output.body, context),
3387
3370
  };
3388
3371
  let response;
3389
- let errorCode = "UnknownError";
3390
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3372
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3391
3373
  switch (errorCode) {
3392
3374
  case "BadRequestException":
3393
3375
  case "com.amazonaws.appsync#BadRequestException":
@@ -3403,10 +3385,12 @@ const deserializeAws_restJson1ListResolversCommandError = async (output, context
3403
3385
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3404
3386
  default:
3405
3387
  const parsedBody = parsedOutput.body;
3388
+ const $metadata = deserializeMetadata(output);
3389
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3406
3390
  response = new AppSyncServiceException_1.AppSyncServiceException({
3407
- name: parsedBody.code || parsedBody.Code || errorCode,
3391
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3408
3392
  $fault: "client",
3409
- $metadata: deserializeMetadata(output),
3393
+ $metadata,
3410
3394
  });
3411
3395
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3412
3396
  }
@@ -3436,8 +3420,7 @@ const deserializeAws_restJson1ListResolversByFunctionCommandError = async (outpu
3436
3420
  body: await parseBody(output.body, context),
3437
3421
  };
3438
3422
  let response;
3439
- let errorCode = "UnknownError";
3440
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3423
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3441
3424
  switch (errorCode) {
3442
3425
  case "BadRequestException":
3443
3426
  case "com.amazonaws.appsync#BadRequestException":
@@ -3453,10 +3436,12 @@ const deserializeAws_restJson1ListResolversByFunctionCommandError = async (outpu
3453
3436
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3454
3437
  default:
3455
3438
  const parsedBody = parsedOutput.body;
3439
+ const $metadata = deserializeMetadata(output);
3440
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3456
3441
  response = new AppSyncServiceException_1.AppSyncServiceException({
3457
- name: parsedBody.code || parsedBody.Code || errorCode,
3442
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3458
3443
  $fault: "client",
3459
- $metadata: deserializeMetadata(output),
3444
+ $metadata,
3460
3445
  });
3461
3446
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3462
3447
  }
@@ -3482,8 +3467,7 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
3482
3467
  body: await parseBody(output.body, context),
3483
3468
  };
3484
3469
  let response;
3485
- let errorCode = "UnknownError";
3486
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3470
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3487
3471
  switch (errorCode) {
3488
3472
  case "AccessDeniedException":
3489
3473
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -3505,10 +3489,12 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
3505
3489
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3506
3490
  default:
3507
3491
  const parsedBody = parsedOutput.body;
3492
+ const $metadata = deserializeMetadata(output);
3493
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3508
3494
  response = new AppSyncServiceException_1.AppSyncServiceException({
3509
- name: parsedBody.code || parsedBody.Code || errorCode,
3495
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3510
3496
  $fault: "client",
3511
- $metadata: deserializeMetadata(output),
3497
+ $metadata,
3512
3498
  });
3513
3499
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3514
3500
  }
@@ -3538,8 +3524,7 @@ const deserializeAws_restJson1ListTypesCommandError = async (output, context) =>
3538
3524
  body: await parseBody(output.body, context),
3539
3525
  };
3540
3526
  let response;
3541
- let errorCode = "UnknownError";
3542
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3527
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3543
3528
  switch (errorCode) {
3544
3529
  case "BadRequestException":
3545
3530
  case "com.amazonaws.appsync#BadRequestException":
@@ -3558,10 +3543,12 @@ const deserializeAws_restJson1ListTypesCommandError = async (output, context) =>
3558
3543
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3559
3544
  default:
3560
3545
  const parsedBody = parsedOutput.body;
3546
+ const $metadata = deserializeMetadata(output);
3547
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3561
3548
  response = new AppSyncServiceException_1.AppSyncServiceException({
3562
- name: parsedBody.code || parsedBody.Code || errorCode,
3549
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3563
3550
  $fault: "client",
3564
- $metadata: deserializeMetadata(output),
3551
+ $metadata,
3565
3552
  });
3566
3553
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3567
3554
  }
@@ -3587,8 +3574,7 @@ const deserializeAws_restJson1StartSchemaCreationCommandError = async (output, c
3587
3574
  body: await parseBody(output.body, context),
3588
3575
  };
3589
3576
  let response;
3590
- let errorCode = "UnknownError";
3591
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3577
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3592
3578
  switch (errorCode) {
3593
3579
  case "BadRequestException":
3594
3580
  case "com.amazonaws.appsync#BadRequestException":
@@ -3607,10 +3593,12 @@ const deserializeAws_restJson1StartSchemaCreationCommandError = async (output, c
3607
3593
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3608
3594
  default:
3609
3595
  const parsedBody = parsedOutput.body;
3596
+ const $metadata = deserializeMetadata(output);
3597
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3610
3598
  response = new AppSyncServiceException_1.AppSyncServiceException({
3611
- name: parsedBody.code || parsedBody.Code || errorCode,
3599
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3612
3600
  $fault: "client",
3613
- $metadata: deserializeMetadata(output),
3601
+ $metadata,
3614
3602
  });
3615
3603
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3616
3604
  }
@@ -3632,8 +3620,7 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3632
3620
  body: await parseBody(output.body, context),
3633
3621
  };
3634
3622
  let response;
3635
- let errorCode = "UnknownError";
3636
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3623
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3637
3624
  switch (errorCode) {
3638
3625
  case "AccessDeniedException":
3639
3626
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -3655,10 +3642,12 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3655
3642
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3656
3643
  default:
3657
3644
  const parsedBody = parsedOutput.body;
3645
+ const $metadata = deserializeMetadata(output);
3646
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3658
3647
  response = new AppSyncServiceException_1.AppSyncServiceException({
3659
- name: parsedBody.code || parsedBody.Code || errorCode,
3648
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3660
3649
  $fault: "client",
3661
- $metadata: deserializeMetadata(output),
3650
+ $metadata,
3662
3651
  });
3663
3652
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3664
3653
  }
@@ -3680,8 +3669,7 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3680
3669
  body: await parseBody(output.body, context),
3681
3670
  };
3682
3671
  let response;
3683
- let errorCode = "UnknownError";
3684
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3672
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3685
3673
  switch (errorCode) {
3686
3674
  case "AccessDeniedException":
3687
3675
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -3703,10 +3691,12 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3703
3691
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3704
3692
  default:
3705
3693
  const parsedBody = parsedOutput.body;
3694
+ const $metadata = deserializeMetadata(output);
3695
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3706
3696
  response = new AppSyncServiceException_1.AppSyncServiceException({
3707
- name: parsedBody.code || parsedBody.Code || errorCode,
3697
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3708
3698
  $fault: "client",
3709
- $metadata: deserializeMetadata(output),
3699
+ $metadata,
3710
3700
  });
3711
3701
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3712
3702
  }
@@ -3732,8 +3722,7 @@ const deserializeAws_restJson1UpdateApiCacheCommandError = async (output, contex
3732
3722
  body: await parseBody(output.body, context),
3733
3723
  };
3734
3724
  let response;
3735
- let errorCode = "UnknownError";
3736
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3725
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3737
3726
  switch (errorCode) {
3738
3727
  case "BadRequestException":
3739
3728
  case "com.amazonaws.appsync#BadRequestException":
@@ -3752,10 +3741,12 @@ const deserializeAws_restJson1UpdateApiCacheCommandError = async (output, contex
3752
3741
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3753
3742
  default:
3754
3743
  const parsedBody = parsedOutput.body;
3744
+ const $metadata = deserializeMetadata(output);
3745
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3755
3746
  response = new AppSyncServiceException_1.AppSyncServiceException({
3756
- name: parsedBody.code || parsedBody.Code || errorCode,
3747
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3757
3748
  $fault: "client",
3758
- $metadata: deserializeMetadata(output),
3749
+ $metadata,
3759
3750
  });
3760
3751
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3761
3752
  }
@@ -3781,8 +3772,7 @@ const deserializeAws_restJson1UpdateApiKeyCommandError = async (output, context)
3781
3772
  body: await parseBody(output.body, context),
3782
3773
  };
3783
3774
  let response;
3784
- let errorCode = "UnknownError";
3785
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3775
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3786
3776
  switch (errorCode) {
3787
3777
  case "ApiKeyValidityOutOfBoundsException":
3788
3778
  case "com.amazonaws.appsync#ApiKeyValidityOutOfBoundsException":
@@ -3804,10 +3794,12 @@ const deserializeAws_restJson1UpdateApiKeyCommandError = async (output, context)
3804
3794
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3805
3795
  default:
3806
3796
  const parsedBody = parsedOutput.body;
3797
+ const $metadata = deserializeMetadata(output);
3798
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3807
3799
  response = new AppSyncServiceException_1.AppSyncServiceException({
3808
- name: parsedBody.code || parsedBody.Code || errorCode,
3800
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3809
3801
  $fault: "client",
3810
- $metadata: deserializeMetadata(output),
3802
+ $metadata,
3811
3803
  });
3812
3804
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3813
3805
  }
@@ -3833,8 +3825,7 @@ const deserializeAws_restJson1UpdateDataSourceCommandError = async (output, cont
3833
3825
  body: await parseBody(output.body, context),
3834
3826
  };
3835
3827
  let response;
3836
- let errorCode = "UnknownError";
3837
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3828
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3838
3829
  switch (errorCode) {
3839
3830
  case "BadRequestException":
3840
3831
  case "com.amazonaws.appsync#BadRequestException":
@@ -3853,10 +3844,12 @@ const deserializeAws_restJson1UpdateDataSourceCommandError = async (output, cont
3853
3844
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3854
3845
  default:
3855
3846
  const parsedBody = parsedOutput.body;
3847
+ const $metadata = deserializeMetadata(output);
3848
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3856
3849
  response = new AppSyncServiceException_1.AppSyncServiceException({
3857
- name: parsedBody.code || parsedBody.Code || errorCode,
3850
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3858
3851
  $fault: "client",
3859
- $metadata: deserializeMetadata(output),
3852
+ $metadata,
3860
3853
  });
3861
3854
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3862
3855
  }
@@ -3882,8 +3875,7 @@ const deserializeAws_restJson1UpdateDomainNameCommandError = async (output, cont
3882
3875
  body: await parseBody(output.body, context),
3883
3876
  };
3884
3877
  let response;
3885
- let errorCode = "UnknownError";
3886
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3878
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3887
3879
  switch (errorCode) {
3888
3880
  case "AccessDeniedException":
3889
3881
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -3902,10 +3894,12 @@ const deserializeAws_restJson1UpdateDomainNameCommandError = async (output, cont
3902
3894
  throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3903
3895
  default:
3904
3896
  const parsedBody = parsedOutput.body;
3897
+ const $metadata = deserializeMetadata(output);
3898
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3905
3899
  response = new AppSyncServiceException_1.AppSyncServiceException({
3906
- name: parsedBody.code || parsedBody.Code || errorCode,
3900
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3907
3901
  $fault: "client",
3908
- $metadata: deserializeMetadata(output),
3902
+ $metadata,
3909
3903
  });
3910
3904
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3911
3905
  }
@@ -3931,8 +3925,7 @@ const deserializeAws_restJson1UpdateFunctionCommandError = async (output, contex
3931
3925
  body: await parseBody(output.body, context),
3932
3926
  };
3933
3927
  let response;
3934
- let errorCode = "UnknownError";
3935
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3928
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3936
3929
  switch (errorCode) {
3937
3930
  case "ConcurrentModificationException":
3938
3931
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -3948,10 +3941,12 @@ const deserializeAws_restJson1UpdateFunctionCommandError = async (output, contex
3948
3941
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3949
3942
  default:
3950
3943
  const parsedBody = parsedOutput.body;
3944
+ const $metadata = deserializeMetadata(output);
3945
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3951
3946
  response = new AppSyncServiceException_1.AppSyncServiceException({
3952
- name: parsedBody.code || parsedBody.Code || errorCode,
3947
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3953
3948
  $fault: "client",
3954
- $metadata: deserializeMetadata(output),
3949
+ $metadata,
3955
3950
  });
3956
3951
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3957
3952
  }
@@ -3977,8 +3972,7 @@ const deserializeAws_restJson1UpdateGraphqlApiCommandError = async (output, cont
3977
3972
  body: await parseBody(output.body, context),
3978
3973
  };
3979
3974
  let response;
3980
- let errorCode = "UnknownError";
3981
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3975
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3982
3976
  switch (errorCode) {
3983
3977
  case "AccessDeniedException":
3984
3978
  case "com.amazonaws.appsync#AccessDeniedException":
@@ -4000,10 +3994,12 @@ const deserializeAws_restJson1UpdateGraphqlApiCommandError = async (output, cont
4000
3994
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4001
3995
  default:
4002
3996
  const parsedBody = parsedOutput.body;
3997
+ const $metadata = deserializeMetadata(output);
3998
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4003
3999
  response = new AppSyncServiceException_1.AppSyncServiceException({
4004
- name: parsedBody.code || parsedBody.Code || errorCode,
4000
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4005
4001
  $fault: "client",
4006
- $metadata: deserializeMetadata(output),
4002
+ $metadata,
4007
4003
  });
4008
4004
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4009
4005
  }
@@ -4029,8 +4025,7 @@ const deserializeAws_restJson1UpdateResolverCommandError = async (output, contex
4029
4025
  body: await parseBody(output.body, context),
4030
4026
  };
4031
4027
  let response;
4032
- let errorCode = "UnknownError";
4033
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4028
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4034
4029
  switch (errorCode) {
4035
4030
  case "ConcurrentModificationException":
4036
4031
  case "com.amazonaws.appsync#ConcurrentModificationException":
@@ -4046,10 +4041,12 @@ const deserializeAws_restJson1UpdateResolverCommandError = async (output, contex
4046
4041
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4047
4042
  default:
4048
4043
  const parsedBody = parsedOutput.body;
4044
+ const $metadata = deserializeMetadata(output);
4045
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4049
4046
  response = new AppSyncServiceException_1.AppSyncServiceException({
4050
- name: parsedBody.code || parsedBody.Code || errorCode,
4047
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4051
4048
  $fault: "client",
4052
- $metadata: deserializeMetadata(output),
4049
+ $metadata,
4053
4050
  });
4054
4051
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4055
4052
  }
@@ -4075,8 +4072,7 @@ const deserializeAws_restJson1UpdateTypeCommandError = async (output, context) =
4075
4072
  body: await parseBody(output.body, context),
4076
4073
  };
4077
4074
  let response;
4078
- let errorCode = "UnknownError";
4079
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4075
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4080
4076
  switch (errorCode) {
4081
4077
  case "BadRequestException":
4082
4078
  case "com.amazonaws.appsync#BadRequestException":
@@ -4095,10 +4091,12 @@ const deserializeAws_restJson1UpdateTypeCommandError = async (output, context) =
4095
4091
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4096
4092
  default:
4097
4093
  const parsedBody = parsedOutput.body;
4094
+ const $metadata = deserializeMetadata(output);
4095
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4098
4096
  response = new AppSyncServiceException_1.AppSyncServiceException({
4099
- name: parsedBody.code || parsedBody.Code || errorCode,
4097
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4100
4098
  $fault: "client",
4101
- $metadata: deserializeMetadata(output),
4099
+ $metadata,
4102
4100
  });
4103
4101
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4104
4102
  }
@@ -4237,18 +4235,14 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutpu
4237
4235
  };
4238
4236
  const serializeAws_restJson1AdditionalAuthenticationProvider = (input, context) => {
4239
4237
  return {
4240
- ...(input.authenticationType !== undefined &&
4241
- input.authenticationType !== null && { authenticationType: input.authenticationType }),
4242
- ...(input.lambdaAuthorizerConfig !== undefined &&
4243
- input.lambdaAuthorizerConfig !== null && {
4238
+ ...(input.authenticationType != null && { authenticationType: input.authenticationType }),
4239
+ ...(input.lambdaAuthorizerConfig != null && {
4244
4240
  lambdaAuthorizerConfig: serializeAws_restJson1LambdaAuthorizerConfig(input.lambdaAuthorizerConfig, context),
4245
4241
  }),
4246
- ...(input.openIDConnectConfig !== undefined &&
4247
- input.openIDConnectConfig !== null && {
4242
+ ...(input.openIDConnectConfig != null && {
4248
4243
  openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context),
4249
4244
  }),
4250
- ...(input.userPoolConfig !== undefined &&
4251
- input.userPoolConfig !== null && {
4245
+ ...(input.userPoolConfig != null && {
4252
4246
  userPoolConfig: serializeAws_restJson1CognitoUserPoolConfig(input.userPoolConfig, context),
4253
4247
  }),
4254
4248
  };
@@ -4265,24 +4259,22 @@ const serializeAws_restJson1AdditionalAuthenticationProviders = (input, context)
4265
4259
  };
4266
4260
  const serializeAws_restJson1AuthorizationConfig = (input, context) => {
4267
4261
  return {
4268
- ...(input.authorizationType !== undefined &&
4269
- input.authorizationType !== null && { authorizationType: input.authorizationType }),
4270
- ...(input.awsIamConfig !== undefined &&
4271
- input.awsIamConfig !== null && { awsIamConfig: serializeAws_restJson1AwsIamConfig(input.awsIamConfig, context) }),
4262
+ ...(input.authorizationType != null && { authorizationType: input.authorizationType }),
4263
+ ...(input.awsIamConfig != null && {
4264
+ awsIamConfig: serializeAws_restJson1AwsIamConfig(input.awsIamConfig, context),
4265
+ }),
4272
4266
  };
4273
4267
  };
4274
4268
  const serializeAws_restJson1AwsIamConfig = (input, context) => {
4275
4269
  return {
4276
- ...(input.signingRegion !== undefined && input.signingRegion !== null && { signingRegion: input.signingRegion }),
4277
- ...(input.signingServiceName !== undefined &&
4278
- input.signingServiceName !== null && { signingServiceName: input.signingServiceName }),
4270
+ ...(input.signingRegion != null && { signingRegion: input.signingRegion }),
4271
+ ...(input.signingServiceName != null && { signingServiceName: input.signingServiceName }),
4279
4272
  };
4280
4273
  };
4281
4274
  const serializeAws_restJson1CachingConfig = (input, context) => {
4282
4275
  return {
4283
- ...(input.cachingKeys !== undefined &&
4284
- input.cachingKeys !== null && { cachingKeys: serializeAws_restJson1CachingKeys(input.cachingKeys, context) }),
4285
- ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }),
4276
+ ...(input.cachingKeys != null && { cachingKeys: serializeAws_restJson1CachingKeys(input.cachingKeys, context) }),
4277
+ ...(input.ttl != null && { ttl: input.ttl }),
4286
4278
  };
4287
4279
  };
4288
4280
  const serializeAws_restJson1CachingKeys = (input, context) => {
@@ -4297,38 +4289,33 @@ const serializeAws_restJson1CachingKeys = (input, context) => {
4297
4289
  };
4298
4290
  const serializeAws_restJson1CognitoUserPoolConfig = (input, context) => {
4299
4291
  return {
4300
- ...(input.appIdClientRegex !== undefined &&
4301
- input.appIdClientRegex !== null && { appIdClientRegex: input.appIdClientRegex }),
4302
- ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }),
4303
- ...(input.userPoolId !== undefined && input.userPoolId !== null && { userPoolId: input.userPoolId }),
4292
+ ...(input.appIdClientRegex != null && { appIdClientRegex: input.appIdClientRegex }),
4293
+ ...(input.awsRegion != null && { awsRegion: input.awsRegion }),
4294
+ ...(input.userPoolId != null && { userPoolId: input.userPoolId }),
4304
4295
  };
4305
4296
  };
4306
4297
  const serializeAws_restJson1DeltaSyncConfig = (input, context) => {
4307
4298
  return {
4308
- ...(input.baseTableTTL !== undefined && input.baseTableTTL !== null && { baseTableTTL: input.baseTableTTL }),
4309
- ...(input.deltaSyncTableName !== undefined &&
4310
- input.deltaSyncTableName !== null && { deltaSyncTableName: input.deltaSyncTableName }),
4311
- ...(input.deltaSyncTableTTL !== undefined &&
4312
- input.deltaSyncTableTTL !== null && { deltaSyncTableTTL: input.deltaSyncTableTTL }),
4299
+ ...(input.baseTableTTL != null && { baseTableTTL: input.baseTableTTL }),
4300
+ ...(input.deltaSyncTableName != null && { deltaSyncTableName: input.deltaSyncTableName }),
4301
+ ...(input.deltaSyncTableTTL != null && { deltaSyncTableTTL: input.deltaSyncTableTTL }),
4313
4302
  };
4314
4303
  };
4315
4304
  const serializeAws_restJson1DynamodbDataSourceConfig = (input, context) => {
4316
4305
  return {
4317
- ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }),
4318
- ...(input.deltaSyncConfig !== undefined &&
4319
- input.deltaSyncConfig !== null && {
4306
+ ...(input.awsRegion != null && { awsRegion: input.awsRegion }),
4307
+ ...(input.deltaSyncConfig != null && {
4320
4308
  deltaSyncConfig: serializeAws_restJson1DeltaSyncConfig(input.deltaSyncConfig, context),
4321
4309
  }),
4322
- ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }),
4323
- ...(input.useCallerCredentials !== undefined &&
4324
- input.useCallerCredentials !== null && { useCallerCredentials: input.useCallerCredentials }),
4325
- ...(input.versioned !== undefined && input.versioned !== null && { versioned: input.versioned }),
4310
+ ...(input.tableName != null && { tableName: input.tableName }),
4311
+ ...(input.useCallerCredentials != null && { useCallerCredentials: input.useCallerCredentials }),
4312
+ ...(input.versioned != null && { versioned: input.versioned }),
4326
4313
  };
4327
4314
  };
4328
4315
  const serializeAws_restJson1ElasticsearchDataSourceConfig = (input, context) => {
4329
4316
  return {
4330
- ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }),
4331
- ...(input.endpoint !== undefined && input.endpoint !== null && { endpoint: input.endpoint }),
4317
+ ...(input.awsRegion != null && { awsRegion: input.awsRegion }),
4318
+ ...(input.endpoint != null && { endpoint: input.endpoint }),
4332
4319
  };
4333
4320
  };
4334
4321
  const serializeAws_restJson1FunctionsIds = (input, context) => {
@@ -4343,98 +4330,83 @@ const serializeAws_restJson1FunctionsIds = (input, context) => {
4343
4330
  };
4344
4331
  const serializeAws_restJson1HttpDataSourceConfig = (input, context) => {
4345
4332
  return {
4346
- ...(input.authorizationConfig !== undefined &&
4347
- input.authorizationConfig !== null && {
4333
+ ...(input.authorizationConfig != null && {
4348
4334
  authorizationConfig: serializeAws_restJson1AuthorizationConfig(input.authorizationConfig, context),
4349
4335
  }),
4350
- ...(input.endpoint !== undefined && input.endpoint !== null && { endpoint: input.endpoint }),
4336
+ ...(input.endpoint != null && { endpoint: input.endpoint }),
4351
4337
  };
4352
4338
  };
4353
4339
  const serializeAws_restJson1LambdaAuthorizerConfig = (input, context) => {
4354
4340
  return {
4355
- ...(input.authorizerResultTtlInSeconds !== undefined &&
4356
- input.authorizerResultTtlInSeconds !== null && {
4341
+ ...(input.authorizerResultTtlInSeconds != null && {
4357
4342
  authorizerResultTtlInSeconds: input.authorizerResultTtlInSeconds,
4358
4343
  }),
4359
- ...(input.authorizerUri !== undefined && input.authorizerUri !== null && { authorizerUri: input.authorizerUri }),
4360
- ...(input.identityValidationExpression !== undefined &&
4361
- input.identityValidationExpression !== null && {
4344
+ ...(input.authorizerUri != null && { authorizerUri: input.authorizerUri }),
4345
+ ...(input.identityValidationExpression != null && {
4362
4346
  identityValidationExpression: input.identityValidationExpression,
4363
4347
  }),
4364
4348
  };
4365
4349
  };
4366
4350
  const serializeAws_restJson1LambdaConflictHandlerConfig = (input, context) => {
4367
4351
  return {
4368
- ...(input.lambdaConflictHandlerArn !== undefined &&
4369
- input.lambdaConflictHandlerArn !== null && { lambdaConflictHandlerArn: input.lambdaConflictHandlerArn }),
4352
+ ...(input.lambdaConflictHandlerArn != null && { lambdaConflictHandlerArn: input.lambdaConflictHandlerArn }),
4370
4353
  };
4371
4354
  };
4372
4355
  const serializeAws_restJson1LambdaDataSourceConfig = (input, context) => {
4373
4356
  return {
4374
- ...(input.lambdaFunctionArn !== undefined &&
4375
- input.lambdaFunctionArn !== null && { lambdaFunctionArn: input.lambdaFunctionArn }),
4357
+ ...(input.lambdaFunctionArn != null && { lambdaFunctionArn: input.lambdaFunctionArn }),
4376
4358
  };
4377
4359
  };
4378
4360
  const serializeAws_restJson1LogConfig = (input, context) => {
4379
4361
  return {
4380
- ...(input.cloudWatchLogsRoleArn !== undefined &&
4381
- input.cloudWatchLogsRoleArn !== null && { cloudWatchLogsRoleArn: input.cloudWatchLogsRoleArn }),
4382
- ...(input.excludeVerboseContent !== undefined &&
4383
- input.excludeVerboseContent !== null && { excludeVerboseContent: input.excludeVerboseContent }),
4384
- ...(input.fieldLogLevel !== undefined && input.fieldLogLevel !== null && { fieldLogLevel: input.fieldLogLevel }),
4362
+ ...(input.cloudWatchLogsRoleArn != null && { cloudWatchLogsRoleArn: input.cloudWatchLogsRoleArn }),
4363
+ ...(input.excludeVerboseContent != null && { excludeVerboseContent: input.excludeVerboseContent }),
4364
+ ...(input.fieldLogLevel != null && { fieldLogLevel: input.fieldLogLevel }),
4385
4365
  };
4386
4366
  };
4387
4367
  const serializeAws_restJson1OpenIDConnectConfig = (input, context) => {
4388
4368
  return {
4389
- ...(input.authTTL !== undefined && input.authTTL !== null && { authTTL: input.authTTL }),
4390
- ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }),
4391
- ...(input.iatTTL !== undefined && input.iatTTL !== null && { iatTTL: input.iatTTL }),
4392
- ...(input.issuer !== undefined && input.issuer !== null && { issuer: input.issuer }),
4369
+ ...(input.authTTL != null && { authTTL: input.authTTL }),
4370
+ ...(input.clientId != null && { clientId: input.clientId }),
4371
+ ...(input.iatTTL != null && { iatTTL: input.iatTTL }),
4372
+ ...(input.issuer != null && { issuer: input.issuer }),
4393
4373
  };
4394
4374
  };
4395
4375
  const serializeAws_restJson1OpenSearchServiceDataSourceConfig = (input, context) => {
4396
4376
  return {
4397
- ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }),
4398
- ...(input.endpoint !== undefined && input.endpoint !== null && { endpoint: input.endpoint }),
4377
+ ...(input.awsRegion != null && { awsRegion: input.awsRegion }),
4378
+ ...(input.endpoint != null && { endpoint: input.endpoint }),
4399
4379
  };
4400
4380
  };
4401
4381
  const serializeAws_restJson1PipelineConfig = (input, context) => {
4402
4382
  return {
4403
- ...(input.functions !== undefined &&
4404
- input.functions !== null && { functions: serializeAws_restJson1FunctionsIds(input.functions, context) }),
4383
+ ...(input.functions != null && { functions: serializeAws_restJson1FunctionsIds(input.functions, context) }),
4405
4384
  };
4406
4385
  };
4407
4386
  const serializeAws_restJson1RdsHttpEndpointConfig = (input, context) => {
4408
4387
  return {
4409
- ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }),
4410
- ...(input.awsSecretStoreArn !== undefined &&
4411
- input.awsSecretStoreArn !== null && { awsSecretStoreArn: input.awsSecretStoreArn }),
4412
- ...(input.databaseName !== undefined && input.databaseName !== null && { databaseName: input.databaseName }),
4413
- ...(input.dbClusterIdentifier !== undefined &&
4414
- input.dbClusterIdentifier !== null && { dbClusterIdentifier: input.dbClusterIdentifier }),
4415
- ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }),
4388
+ ...(input.awsRegion != null && { awsRegion: input.awsRegion }),
4389
+ ...(input.awsSecretStoreArn != null && { awsSecretStoreArn: input.awsSecretStoreArn }),
4390
+ ...(input.databaseName != null && { databaseName: input.databaseName }),
4391
+ ...(input.dbClusterIdentifier != null && { dbClusterIdentifier: input.dbClusterIdentifier }),
4392
+ ...(input.schema != null && { schema: input.schema }),
4416
4393
  };
4417
4394
  };
4418
4395
  const serializeAws_restJson1RelationalDatabaseDataSourceConfig = (input, context) => {
4419
4396
  return {
4420
- ...(input.rdsHttpEndpointConfig !== undefined &&
4421
- input.rdsHttpEndpointConfig !== null && {
4397
+ ...(input.rdsHttpEndpointConfig != null && {
4422
4398
  rdsHttpEndpointConfig: serializeAws_restJson1RdsHttpEndpointConfig(input.rdsHttpEndpointConfig, context),
4423
4399
  }),
4424
- ...(input.relationalDatabaseSourceType !== undefined &&
4425
- input.relationalDatabaseSourceType !== null && {
4400
+ ...(input.relationalDatabaseSourceType != null && {
4426
4401
  relationalDatabaseSourceType: input.relationalDatabaseSourceType,
4427
4402
  }),
4428
4403
  };
4429
4404
  };
4430
4405
  const serializeAws_restJson1SyncConfig = (input, context) => {
4431
4406
  return {
4432
- ...(input.conflictDetection !== undefined &&
4433
- input.conflictDetection !== null && { conflictDetection: input.conflictDetection }),
4434
- ...(input.conflictHandler !== undefined &&
4435
- input.conflictHandler !== null && { conflictHandler: input.conflictHandler }),
4436
- ...(input.lambdaConflictHandlerConfig !== undefined &&
4437
- input.lambdaConflictHandlerConfig !== null && {
4407
+ ...(input.conflictDetection != null && { conflictDetection: input.conflictDetection }),
4408
+ ...(input.conflictHandler != null && { conflictHandler: input.conflictHandler }),
4409
+ ...(input.lambdaConflictHandlerConfig != null && {
4438
4410
  lambdaConflictHandlerConfig: serializeAws_restJson1LambdaConflictHandlerConfig(input.lambdaConflictHandlerConfig, context),
4439
4411
  }),
4440
4412
  };
@@ -4452,23 +4424,22 @@ const serializeAws_restJson1TagMap = (input, context) => {
4452
4424
  };
4453
4425
  const serializeAws_restJson1UserPoolConfig = (input, context) => {
4454
4426
  return {
4455
- ...(input.appIdClientRegex !== undefined &&
4456
- input.appIdClientRegex !== null && { appIdClientRegex: input.appIdClientRegex }),
4457
- ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }),
4458
- ...(input.defaultAction !== undefined && input.defaultAction !== null && { defaultAction: input.defaultAction }),
4459
- ...(input.userPoolId !== undefined && input.userPoolId !== null && { userPoolId: input.userPoolId }),
4427
+ ...(input.appIdClientRegex != null && { appIdClientRegex: input.appIdClientRegex }),
4428
+ ...(input.awsRegion != null && { awsRegion: input.awsRegion }),
4429
+ ...(input.defaultAction != null && { defaultAction: input.defaultAction }),
4430
+ ...(input.userPoolId != null && { userPoolId: input.userPoolId }),
4460
4431
  };
4461
4432
  };
4462
4433
  const deserializeAws_restJson1AdditionalAuthenticationProvider = (output, context) => {
4463
4434
  return {
4464
4435
  authenticationType: (0, smithy_client_1.expectString)(output.authenticationType),
4465
- lambdaAuthorizerConfig: output.lambdaAuthorizerConfig !== undefined && output.lambdaAuthorizerConfig !== null
4436
+ lambdaAuthorizerConfig: output.lambdaAuthorizerConfig != null
4466
4437
  ? deserializeAws_restJson1LambdaAuthorizerConfig(output.lambdaAuthorizerConfig, context)
4467
4438
  : undefined,
4468
- openIDConnectConfig: output.openIDConnectConfig !== undefined && output.openIDConnectConfig !== null
4439
+ openIDConnectConfig: output.openIDConnectConfig != null
4469
4440
  ? deserializeAws_restJson1OpenIDConnectConfig(output.openIDConnectConfig, context)
4470
4441
  : undefined,
4471
- userPoolConfig: output.userPoolConfig !== undefined && output.userPoolConfig !== null
4442
+ userPoolConfig: output.userPoolConfig != null
4472
4443
  ? deserializeAws_restJson1CognitoUserPoolConfig(output.userPoolConfig, context)
4473
4444
  : undefined,
4474
4445
  };
@@ -4524,9 +4495,7 @@ const deserializeAws_restJson1ApiKeys = (output, context) => {
4524
4495
  const deserializeAws_restJson1AuthorizationConfig = (output, context) => {
4525
4496
  return {
4526
4497
  authorizationType: (0, smithy_client_1.expectString)(output.authorizationType),
4527
- awsIamConfig: output.awsIamConfig !== undefined && output.awsIamConfig !== null
4528
- ? deserializeAws_restJson1AwsIamConfig(output.awsIamConfig, context)
4529
- : undefined,
4498
+ awsIamConfig: output.awsIamConfig != null ? deserializeAws_restJson1AwsIamConfig(output.awsIamConfig, context) : undefined,
4530
4499
  };
4531
4500
  };
4532
4501
  const deserializeAws_restJson1AwsIamConfig = (output, context) => {
@@ -4537,9 +4506,7 @@ const deserializeAws_restJson1AwsIamConfig = (output, context) => {
4537
4506
  };
4538
4507
  const deserializeAws_restJson1CachingConfig = (output, context) => {
4539
4508
  return {
4540
- cachingKeys: output.cachingKeys !== undefined && output.cachingKeys !== null
4541
- ? deserializeAws_restJson1CachingKeys(output.cachingKeys, context)
4542
- : undefined,
4509
+ cachingKeys: output.cachingKeys != null ? deserializeAws_restJson1CachingKeys(output.cachingKeys, context) : undefined,
4543
4510
  ttl: (0, smithy_client_1.expectLong)(output.ttl),
4544
4511
  };
4545
4512
  };
@@ -4565,23 +4532,21 @@ const deserializeAws_restJson1DataSource = (output, context) => {
4565
4532
  return {
4566
4533
  dataSourceArn: (0, smithy_client_1.expectString)(output.dataSourceArn),
4567
4534
  description: (0, smithy_client_1.expectString)(output.description),
4568
- dynamodbConfig: output.dynamodbConfig !== undefined && output.dynamodbConfig !== null
4535
+ dynamodbConfig: output.dynamodbConfig != null
4569
4536
  ? deserializeAws_restJson1DynamodbDataSourceConfig(output.dynamodbConfig, context)
4570
4537
  : undefined,
4571
- elasticsearchConfig: output.elasticsearchConfig !== undefined && output.elasticsearchConfig !== null
4538
+ elasticsearchConfig: output.elasticsearchConfig != null
4572
4539
  ? deserializeAws_restJson1ElasticsearchDataSourceConfig(output.elasticsearchConfig, context)
4573
4540
  : undefined,
4574
- httpConfig: output.httpConfig !== undefined && output.httpConfig !== null
4575
- ? deserializeAws_restJson1HttpDataSourceConfig(output.httpConfig, context)
4576
- : undefined,
4577
- lambdaConfig: output.lambdaConfig !== undefined && output.lambdaConfig !== null
4541
+ httpConfig: output.httpConfig != null ? deserializeAws_restJson1HttpDataSourceConfig(output.httpConfig, context) : undefined,
4542
+ lambdaConfig: output.lambdaConfig != null
4578
4543
  ? deserializeAws_restJson1LambdaDataSourceConfig(output.lambdaConfig, context)
4579
4544
  : undefined,
4580
4545
  name: (0, smithy_client_1.expectString)(output.name),
4581
- openSearchServiceConfig: output.openSearchServiceConfig !== undefined && output.openSearchServiceConfig !== null
4546
+ openSearchServiceConfig: output.openSearchServiceConfig != null
4582
4547
  ? deserializeAws_restJson1OpenSearchServiceDataSourceConfig(output.openSearchServiceConfig, context)
4583
4548
  : undefined,
4584
- relationalDatabaseConfig: output.relationalDatabaseConfig !== undefined && output.relationalDatabaseConfig !== null
4549
+ relationalDatabaseConfig: output.relationalDatabaseConfig != null
4585
4550
  ? deserializeAws_restJson1RelationalDatabaseDataSourceConfig(output.relationalDatabaseConfig, context)
4586
4551
  : undefined,
4587
4552
  serviceRoleArn: (0, smithy_client_1.expectString)(output.serviceRoleArn),
@@ -4629,7 +4594,7 @@ const deserializeAws_restJson1DomainNameConfigs = (output, context) => {
4629
4594
  const deserializeAws_restJson1DynamodbDataSourceConfig = (output, context) => {
4630
4595
  return {
4631
4596
  awsRegion: (0, smithy_client_1.expectString)(output.awsRegion),
4632
- deltaSyncConfig: output.deltaSyncConfig !== undefined && output.deltaSyncConfig !== null
4597
+ deltaSyncConfig: output.deltaSyncConfig != null
4633
4598
  ? deserializeAws_restJson1DeltaSyncConfig(output.deltaSyncConfig, context)
4634
4599
  : undefined,
4635
4600
  tableName: (0, smithy_client_1.expectString)(output.tableName),
@@ -4654,9 +4619,7 @@ const deserializeAws_restJson1FunctionConfiguration = (output, context) => {
4654
4619
  name: (0, smithy_client_1.expectString)(output.name),
4655
4620
  requestMappingTemplate: (0, smithy_client_1.expectString)(output.requestMappingTemplate),
4656
4621
  responseMappingTemplate: (0, smithy_client_1.expectString)(output.responseMappingTemplate),
4657
- syncConfig: output.syncConfig !== undefined && output.syncConfig !== null
4658
- ? deserializeAws_restJson1SyncConfig(output.syncConfig, context)
4659
- : undefined,
4622
+ syncConfig: output.syncConfig != null ? deserializeAws_restJson1SyncConfig(output.syncConfig, context) : undefined,
4660
4623
  };
4661
4624
  };
4662
4625
  const deserializeAws_restJson1Functions = (output, context) => {
@@ -4683,29 +4646,23 @@ const deserializeAws_restJson1FunctionsIds = (output, context) => {
4683
4646
  };
4684
4647
  const deserializeAws_restJson1GraphqlApi = (output, context) => {
4685
4648
  return {
4686
- additionalAuthenticationProviders: output.additionalAuthenticationProviders !== undefined && output.additionalAuthenticationProviders !== null
4649
+ additionalAuthenticationProviders: output.additionalAuthenticationProviders != null
4687
4650
  ? deserializeAws_restJson1AdditionalAuthenticationProviders(output.additionalAuthenticationProviders, context)
4688
4651
  : undefined,
4689
4652
  apiId: (0, smithy_client_1.expectString)(output.apiId),
4690
4653
  arn: (0, smithy_client_1.expectString)(output.arn),
4691
4654
  authenticationType: (0, smithy_client_1.expectString)(output.authenticationType),
4692
- lambdaAuthorizerConfig: output.lambdaAuthorizerConfig !== undefined && output.lambdaAuthorizerConfig !== null
4655
+ lambdaAuthorizerConfig: output.lambdaAuthorizerConfig != null
4693
4656
  ? deserializeAws_restJson1LambdaAuthorizerConfig(output.lambdaAuthorizerConfig, context)
4694
4657
  : undefined,
4695
- logConfig: output.logConfig !== undefined && output.logConfig !== null
4696
- ? deserializeAws_restJson1LogConfig(output.logConfig, context)
4697
- : undefined,
4658
+ logConfig: output.logConfig != null ? deserializeAws_restJson1LogConfig(output.logConfig, context) : undefined,
4698
4659
  name: (0, smithy_client_1.expectString)(output.name),
4699
- openIDConnectConfig: output.openIDConnectConfig !== undefined && output.openIDConnectConfig !== null
4660
+ openIDConnectConfig: output.openIDConnectConfig != null
4700
4661
  ? deserializeAws_restJson1OpenIDConnectConfig(output.openIDConnectConfig, context)
4701
4662
  : undefined,
4702
- tags: output.tags !== undefined && output.tags !== null
4703
- ? deserializeAws_restJson1TagMap(output.tags, context)
4704
- : undefined,
4705
- uris: output.uris !== undefined && output.uris !== null
4706
- ? deserializeAws_restJson1MapOfStringToString(output.uris, context)
4707
- : undefined,
4708
- userPoolConfig: output.userPoolConfig !== undefined && output.userPoolConfig !== null
4663
+ tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
4664
+ uris: output.uris != null ? deserializeAws_restJson1MapOfStringToString(output.uris, context) : undefined,
4665
+ userPoolConfig: output.userPoolConfig != null
4709
4666
  ? deserializeAws_restJson1UserPoolConfig(output.userPoolConfig, context)
4710
4667
  : undefined,
4711
4668
  wafWebAclArn: (0, smithy_client_1.expectString)(output.wafWebAclArn),
@@ -4725,7 +4682,7 @@ const deserializeAws_restJson1GraphqlApis = (output, context) => {
4725
4682
  };
4726
4683
  const deserializeAws_restJson1HttpDataSourceConfig = (output, context) => {
4727
4684
  return {
4728
- authorizationConfig: output.authorizationConfig !== undefined && output.authorizationConfig !== null
4685
+ authorizationConfig: output.authorizationConfig != null
4729
4686
  ? deserializeAws_restJson1AuthorizationConfig(output.authorizationConfig, context)
4730
4687
  : undefined,
4731
4688
  endpoint: (0, smithy_client_1.expectString)(output.endpoint),
@@ -4782,9 +4739,7 @@ const deserializeAws_restJson1OpenSearchServiceDataSourceConfig = (output, conte
4782
4739
  };
4783
4740
  const deserializeAws_restJson1PipelineConfig = (output, context) => {
4784
4741
  return {
4785
- functions: output.functions !== undefined && output.functions !== null
4786
- ? deserializeAws_restJson1FunctionsIds(output.functions, context)
4787
- : undefined,
4742
+ functions: output.functions != null ? deserializeAws_restJson1FunctionsIds(output.functions, context) : undefined,
4788
4743
  };
4789
4744
  };
4790
4745
  const deserializeAws_restJson1RdsHttpEndpointConfig = (output, context) => {
@@ -4798,7 +4753,7 @@ const deserializeAws_restJson1RdsHttpEndpointConfig = (output, context) => {
4798
4753
  };
4799
4754
  const deserializeAws_restJson1RelationalDatabaseDataSourceConfig = (output, context) => {
4800
4755
  return {
4801
- rdsHttpEndpointConfig: output.rdsHttpEndpointConfig !== undefined && output.rdsHttpEndpointConfig !== null
4756
+ rdsHttpEndpointConfig: output.rdsHttpEndpointConfig != null
4802
4757
  ? deserializeAws_restJson1RdsHttpEndpointConfig(output.rdsHttpEndpointConfig, context)
4803
4758
  : undefined,
4804
4759
  relationalDatabaseSourceType: (0, smithy_client_1.expectString)(output.relationalDatabaseSourceType),
@@ -4806,22 +4761,18 @@ const deserializeAws_restJson1RelationalDatabaseDataSourceConfig = (output, cont
4806
4761
  };
4807
4762
  const deserializeAws_restJson1Resolver = (output, context) => {
4808
4763
  return {
4809
- cachingConfig: output.cachingConfig !== undefined && output.cachingConfig !== null
4810
- ? deserializeAws_restJson1CachingConfig(output.cachingConfig, context)
4811
- : undefined,
4764
+ cachingConfig: output.cachingConfig != null ? deserializeAws_restJson1CachingConfig(output.cachingConfig, context) : undefined,
4812
4765
  dataSourceName: (0, smithy_client_1.expectString)(output.dataSourceName),
4813
4766
  fieldName: (0, smithy_client_1.expectString)(output.fieldName),
4814
4767
  kind: (0, smithy_client_1.expectString)(output.kind),
4815
4768
  maxBatchSize: (0, smithy_client_1.expectInt32)(output.maxBatchSize),
4816
- pipelineConfig: output.pipelineConfig !== undefined && output.pipelineConfig !== null
4769
+ pipelineConfig: output.pipelineConfig != null
4817
4770
  ? deserializeAws_restJson1PipelineConfig(output.pipelineConfig, context)
4818
4771
  : undefined,
4819
4772
  requestMappingTemplate: (0, smithy_client_1.expectString)(output.requestMappingTemplate),
4820
4773
  resolverArn: (0, smithy_client_1.expectString)(output.resolverArn),
4821
4774
  responseMappingTemplate: (0, smithy_client_1.expectString)(output.responseMappingTemplate),
4822
- syncConfig: output.syncConfig !== undefined && output.syncConfig !== null
4823
- ? deserializeAws_restJson1SyncConfig(output.syncConfig, context)
4824
- : undefined,
4775
+ syncConfig: output.syncConfig != null ? deserializeAws_restJson1SyncConfig(output.syncConfig, context) : undefined,
4825
4776
  typeName: (0, smithy_client_1.expectString)(output.typeName),
4826
4777
  };
4827
4778
  };
@@ -4840,7 +4791,7 @@ const deserializeAws_restJson1SyncConfig = (output, context) => {
4840
4791
  return {
4841
4792
  conflictDetection: (0, smithy_client_1.expectString)(output.conflictDetection),
4842
4793
  conflictHandler: (0, smithy_client_1.expectString)(output.conflictHandler),
4843
- lambdaConflictHandlerConfig: output.lambdaConflictHandlerConfig !== undefined && output.lambdaConflictHandlerConfig !== null
4794
+ lambdaConflictHandlerConfig: output.lambdaConflictHandlerConfig != null
4844
4795
  ? deserializeAws_restJson1LambdaConflictHandlerConfig(output.lambdaConflictHandlerConfig, context)
4845
4796
  : undefined,
4846
4797
  };
@@ -4933,5 +4884,4 @@ const loadRestJsonErrorCode = (output, data) => {
4933
4884
  if (data["__type"] !== undefined) {
4934
4885
  return sanitizeErrorCode(data["__type"]);
4935
4886
  }
4936
- return "";
4937
4887
  };