@aws-sdk/client-appsync 3.141.0 → 3.150.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.
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { AppSyncServiceException as __BaseException } from "../models/AppSyncServiceException";
5
5
  import { AccessDeniedException, ApiKeyLimitExceededException, ApiKeyValidityOutOfBoundsException, ApiLimitExceededException, BadRequestException, ConcurrentModificationException, GraphQLSchemaException, InternalFailureException, LimitExceededException, NotFoundException, UnauthorizedException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1AssociateApiCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -15,16 +15,7 @@ export var serializeAws_restJson1AssociateApiCommand = function (input, context)
15
15
  };
16
16
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
17
17
  "/v1/domainnames/{domainName}/apiassociation";
18
- if (input.domainName !== undefined) {
19
- labelValue = input.domainName;
20
- if (labelValue.length <= 0) {
21
- throw new Error("Empty value provided for input HTTP label: domainName.");
22
- }
23
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
24
- }
25
- else {
26
- throw new Error("No value provided for input HTTP label: domainName.");
27
- }
18
+ resolvedPath = __resolvedPath(resolvedPath, input, "domainName", function () { return input.domainName; }, "{domainName}", false);
28
19
  body = JSON.stringify(__assign({}, (input.apiId != null && { apiId: input.apiId })));
29
20
  return [2, new __HttpRequest({
30
21
  protocol: protocol,
@@ -39,7 +30,7 @@ export var serializeAws_restJson1AssociateApiCommand = function (input, context)
39
30
  });
40
31
  }); };
41
32
  export var serializeAws_restJson1CreateApiCacheCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
42
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
33
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
43
34
  return __generator(this, function (_c) {
44
35
  switch (_c.label) {
45
36
  case 0: return [4, context.endpoint()];
@@ -49,16 +40,7 @@ export var serializeAws_restJson1CreateApiCacheCommand = function (input, contex
49
40
  "content-type": "application/json",
50
41
  };
51
42
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/ApiCaches";
52
- if (input.apiId !== undefined) {
53
- labelValue = input.apiId;
54
- if (labelValue.length <= 0) {
55
- throw new Error("Empty value provided for input HTTP label: apiId.");
56
- }
57
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
58
- }
59
- else {
60
- throw new Error("No value provided for input HTTP label: apiId.");
61
- }
43
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
62
44
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.apiCachingBehavior != null && { apiCachingBehavior: input.apiCachingBehavior })), (input.atRestEncryptionEnabled != null && { atRestEncryptionEnabled: input.atRestEncryptionEnabled })), (input.transitEncryptionEnabled != null && { transitEncryptionEnabled: input.transitEncryptionEnabled })), (input.ttl != null && { ttl: input.ttl })), (input.type != null && { type: input.type })));
63
45
  return [2, new __HttpRequest({
64
46
  protocol: protocol,
@@ -73,7 +55,7 @@ export var serializeAws_restJson1CreateApiCacheCommand = function (input, contex
73
55
  });
74
56
  }); };
75
57
  export var serializeAws_restJson1CreateApiKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
76
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
58
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
77
59
  return __generator(this, function (_c) {
78
60
  switch (_c.label) {
79
61
  case 0: return [4, context.endpoint()];
@@ -83,16 +65,7 @@ export var serializeAws_restJson1CreateApiKeyCommand = function (input, context)
83
65
  "content-type": "application/json",
84
66
  };
85
67
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/apikeys";
86
- if (input.apiId !== undefined) {
87
- labelValue = input.apiId;
88
- if (labelValue.length <= 0) {
89
- throw new Error("Empty value provided for input HTTP label: apiId.");
90
- }
91
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
92
- }
93
- else {
94
- throw new Error("No value provided for input HTTP label: apiId.");
95
- }
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
96
69
  body = JSON.stringify(__assign(__assign({}, (input.description != null && { description: input.description })), (input.expires != null && { expires: input.expires })));
97
70
  return [2, new __HttpRequest({
98
71
  protocol: protocol,
@@ -107,7 +80,7 @@ export var serializeAws_restJson1CreateApiKeyCommand = function (input, context)
107
80
  });
108
81
  }); };
109
82
  export var serializeAws_restJson1CreateDataSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
110
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
83
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
111
84
  return __generator(this, function (_c) {
112
85
  switch (_c.label) {
113
86
  case 0: return [4, context.endpoint()];
@@ -117,16 +90,7 @@ export var serializeAws_restJson1CreateDataSourceCommand = function (input, cont
117
90
  "content-type": "application/json",
118
91
  };
119
92
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/datasources";
120
- if (input.apiId !== undefined) {
121
- labelValue = input.apiId;
122
- if (labelValue.length <= 0) {
123
- throw new Error("Empty value provided for input HTTP label: apiId.");
124
- }
125
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
126
- }
127
- else {
128
- throw new Error("No value provided for input HTTP label: apiId.");
129
- }
93
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
130
94
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.dynamodbConfig != null && {
131
95
  dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context),
132
96
  })), (input.elasticsearchConfig != null && {
@@ -177,7 +141,7 @@ export var serializeAws_restJson1CreateDomainNameCommand = function (input, cont
177
141
  });
178
142
  }); };
179
143
  export var serializeAws_restJson1CreateFunctionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
180
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
144
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
181
145
  return __generator(this, function (_c) {
182
146
  switch (_c.label) {
183
147
  case 0: return [4, context.endpoint()];
@@ -187,16 +151,7 @@ export var serializeAws_restJson1CreateFunctionCommand = function (input, contex
187
151
  "content-type": "application/json",
188
152
  };
189
153
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/functions";
190
- if (input.apiId !== undefined) {
191
- labelValue = input.apiId;
192
- if (labelValue.length <= 0) {
193
- throw new Error("Empty value provided for input HTTP label: apiId.");
194
- }
195
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
196
- }
197
- else {
198
- throw new Error("No value provided for input HTTP label: apiId.");
199
- }
154
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
200
155
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.dataSourceName != null && { dataSourceName: input.dataSourceName })), (input.description != null && { description: input.description })), (input.functionVersion != null && { functionVersion: input.functionVersion })), (input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize })), (input.name != null && { name: input.name })), (input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate })), (input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate })), (input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) })));
201
156
  return [2, new __HttpRequest({
202
157
  protocol: protocol,
@@ -243,7 +198,7 @@ export var serializeAws_restJson1CreateGraphqlApiCommand = function (input, cont
243
198
  });
244
199
  }); };
245
200
  export var serializeAws_restJson1CreateResolverCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
246
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
201
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
247
202
  return __generator(this, function (_c) {
248
203
  switch (_c.label) {
249
204
  case 0: return [4, context.endpoint()];
@@ -254,26 +209,8 @@ export var serializeAws_restJson1CreateResolverCommand = function (input, contex
254
209
  };
255
210
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
256
211
  "/v1/apis/{apiId}/types/{typeName}/resolvers";
257
- if (input.apiId !== undefined) {
258
- labelValue = input.apiId;
259
- if (labelValue.length <= 0) {
260
- throw new Error("Empty value provided for input HTTP label: apiId.");
261
- }
262
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
263
- }
264
- else {
265
- throw new Error("No value provided for input HTTP label: apiId.");
266
- }
267
- if (input.typeName !== undefined) {
268
- labelValue = input.typeName;
269
- if (labelValue.length <= 0) {
270
- throw new Error("Empty value provided for input HTTP label: typeName.");
271
- }
272
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
273
- }
274
- else {
275
- throw new Error("No value provided for input HTTP label: typeName.");
276
- }
212
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
213
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
277
214
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.cachingConfig != null && {
278
215
  cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context),
279
216
  })), (input.dataSourceName != null && { dataSourceName: input.dataSourceName })), (input.fieldName != null && { fieldName: input.fieldName })), (input.kind != null && { kind: input.kind })), (input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize })), (input.pipelineConfig != null && {
@@ -292,7 +229,7 @@ export var serializeAws_restJson1CreateResolverCommand = function (input, contex
292
229
  });
293
230
  }); };
294
231
  export var serializeAws_restJson1CreateTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
295
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
232
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
296
233
  return __generator(this, function (_c) {
297
234
  switch (_c.label) {
298
235
  case 0: return [4, context.endpoint()];
@@ -302,16 +239,7 @@ export var serializeAws_restJson1CreateTypeCommand = function (input, context) {
302
239
  "content-type": "application/json",
303
240
  };
304
241
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/types";
305
- if (input.apiId !== undefined) {
306
- labelValue = input.apiId;
307
- if (labelValue.length <= 0) {
308
- throw new Error("Empty value provided for input HTTP label: apiId.");
309
- }
310
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
311
- }
312
- else {
313
- throw new Error("No value provided for input HTTP label: apiId.");
314
- }
242
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
315
243
  body = JSON.stringify(__assign(__assign({}, (input.definition != null && { definition: input.definition })), (input.format != null && { format: input.format })));
316
244
  return [2, new __HttpRequest({
317
245
  protocol: protocol,
@@ -326,7 +254,7 @@ export var serializeAws_restJson1CreateTypeCommand = function (input, context) {
326
254
  });
327
255
  }); };
328
256
  export var serializeAws_restJson1DeleteApiCacheCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
329
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
257
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
330
258
  return __generator(this, function (_c) {
331
259
  switch (_c.label) {
332
260
  case 0: return [4, context.endpoint()];
@@ -334,16 +262,7 @@ export var serializeAws_restJson1DeleteApiCacheCommand = function (input, contex
334
262
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
335
263
  headers = {};
336
264
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/ApiCaches";
337
- if (input.apiId !== undefined) {
338
- labelValue = input.apiId;
339
- if (labelValue.length <= 0) {
340
- throw new Error("Empty value provided for input HTTP label: apiId.");
341
- }
342
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
343
- }
344
- else {
345
- throw new Error("No value provided for input HTTP label: apiId.");
346
- }
265
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
347
266
  return [2, new __HttpRequest({
348
267
  protocol: protocol,
349
268
  hostname: hostname,
@@ -357,7 +276,7 @@ export var serializeAws_restJson1DeleteApiCacheCommand = function (input, contex
357
276
  });
358
277
  }); };
359
278
  export var serializeAws_restJson1DeleteApiKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
360
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
279
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
361
280
  return __generator(this, function (_c) {
362
281
  switch (_c.label) {
363
282
  case 0: return [4, context.endpoint()];
@@ -365,26 +284,8 @@ export var serializeAws_restJson1DeleteApiKeyCommand = function (input, context)
365
284
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
366
285
  headers = {};
367
286
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/apikeys/{id}";
368
- if (input.apiId !== undefined) {
369
- labelValue = input.apiId;
370
- if (labelValue.length <= 0) {
371
- throw new Error("Empty value provided for input HTTP label: apiId.");
372
- }
373
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
374
- }
375
- else {
376
- throw new Error("No value provided for input HTTP label: apiId.");
377
- }
378
- if (input.id !== undefined) {
379
- labelValue = input.id;
380
- if (labelValue.length <= 0) {
381
- throw new Error("Empty value provided for input HTTP label: id.");
382
- }
383
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
384
- }
385
- else {
386
- throw new Error("No value provided for input HTTP label: id.");
387
- }
287
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
288
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
388
289
  return [2, new __HttpRequest({
389
290
  protocol: protocol,
390
291
  hostname: hostname,
@@ -398,7 +299,7 @@ export var serializeAws_restJson1DeleteApiKeyCommand = function (input, context)
398
299
  });
399
300
  }); };
400
301
  export var serializeAws_restJson1DeleteDataSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
401
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
302
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
402
303
  return __generator(this, function (_c) {
403
304
  switch (_c.label) {
404
305
  case 0: return [4, context.endpoint()];
@@ -406,26 +307,8 @@ export var serializeAws_restJson1DeleteDataSourceCommand = function (input, cont
406
307
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
407
308
  headers = {};
408
309
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/datasources/{name}";
409
- if (input.apiId !== undefined) {
410
- labelValue = input.apiId;
411
- if (labelValue.length <= 0) {
412
- throw new Error("Empty value provided for input HTTP label: apiId.");
413
- }
414
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
415
- }
416
- else {
417
- throw new Error("No value provided for input HTTP label: apiId.");
418
- }
419
- if (input.name !== undefined) {
420
- labelValue = input.name;
421
- if (labelValue.length <= 0) {
422
- throw new Error("Empty value provided for input HTTP label: name.");
423
- }
424
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
425
- }
426
- else {
427
- throw new Error("No value provided for input HTTP label: name.");
428
- }
310
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
311
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
429
312
  return [2, new __HttpRequest({
430
313
  protocol: protocol,
431
314
  hostname: hostname,
@@ -439,7 +322,7 @@ export var serializeAws_restJson1DeleteDataSourceCommand = function (input, cont
439
322
  });
440
323
  }); };
441
324
  export var serializeAws_restJson1DeleteDomainNameCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
442
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
325
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
443
326
  return __generator(this, function (_c) {
444
327
  switch (_c.label) {
445
328
  case 0: return [4, context.endpoint()];
@@ -447,16 +330,7 @@ export var serializeAws_restJson1DeleteDomainNameCommand = function (input, cont
447
330
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
448
331
  headers = {};
449
332
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/domainnames/{domainName}";
450
- if (input.domainName !== undefined) {
451
- labelValue = input.domainName;
452
- if (labelValue.length <= 0) {
453
- throw new Error("Empty value provided for input HTTP label: domainName.");
454
- }
455
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
456
- }
457
- else {
458
- throw new Error("No value provided for input HTTP label: domainName.");
459
- }
333
+ resolvedPath = __resolvedPath(resolvedPath, input, "domainName", function () { return input.domainName; }, "{domainName}", false);
460
334
  return [2, new __HttpRequest({
461
335
  protocol: protocol,
462
336
  hostname: hostname,
@@ -470,7 +344,7 @@ export var serializeAws_restJson1DeleteDomainNameCommand = function (input, cont
470
344
  });
471
345
  }); };
472
346
  export var serializeAws_restJson1DeleteFunctionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
473
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
347
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
474
348
  return __generator(this, function (_c) {
475
349
  switch (_c.label) {
476
350
  case 0: return [4, context.endpoint()];
@@ -478,26 +352,8 @@ export var serializeAws_restJson1DeleteFunctionCommand = function (input, contex
478
352
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
479
353
  headers = {};
480
354
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/functions/{functionId}";
481
- if (input.apiId !== undefined) {
482
- labelValue = input.apiId;
483
- if (labelValue.length <= 0) {
484
- throw new Error("Empty value provided for input HTTP label: apiId.");
485
- }
486
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
487
- }
488
- else {
489
- throw new Error("No value provided for input HTTP label: apiId.");
490
- }
491
- if (input.functionId !== undefined) {
492
- labelValue = input.functionId;
493
- if (labelValue.length <= 0) {
494
- throw new Error("Empty value provided for input HTTP label: functionId.");
495
- }
496
- resolvedPath = resolvedPath.replace("{functionId}", __extendedEncodeURIComponent(labelValue));
497
- }
498
- else {
499
- throw new Error("No value provided for input HTTP label: functionId.");
500
- }
355
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
356
+ resolvedPath = __resolvedPath(resolvedPath, input, "functionId", function () { return input.functionId; }, "{functionId}", false);
501
357
  return [2, new __HttpRequest({
502
358
  protocol: protocol,
503
359
  hostname: hostname,
@@ -511,7 +367,7 @@ export var serializeAws_restJson1DeleteFunctionCommand = function (input, contex
511
367
  });
512
368
  }); };
513
369
  export var serializeAws_restJson1DeleteGraphqlApiCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
514
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
370
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
515
371
  return __generator(this, function (_c) {
516
372
  switch (_c.label) {
517
373
  case 0: return [4, context.endpoint()];
@@ -519,16 +375,7 @@ export var serializeAws_restJson1DeleteGraphqlApiCommand = function (input, cont
519
375
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
520
376
  headers = {};
521
377
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}";
522
- if (input.apiId !== undefined) {
523
- labelValue = input.apiId;
524
- if (labelValue.length <= 0) {
525
- throw new Error("Empty value provided for input HTTP label: apiId.");
526
- }
527
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
528
- }
529
- else {
530
- throw new Error("No value provided for input HTTP label: apiId.");
531
- }
378
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
532
379
  return [2, new __HttpRequest({
533
380
  protocol: protocol,
534
381
  hostname: hostname,
@@ -542,7 +389,7 @@ export var serializeAws_restJson1DeleteGraphqlApiCommand = function (input, cont
542
389
  });
543
390
  }); };
544
391
  export var serializeAws_restJson1DeleteResolverCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
545
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
392
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
546
393
  return __generator(this, function (_c) {
547
394
  switch (_c.label) {
548
395
  case 0: return [4, context.endpoint()];
@@ -551,36 +398,9 @@ export var serializeAws_restJson1DeleteResolverCommand = function (input, contex
551
398
  headers = {};
552
399
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
553
400
  "/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}";
554
- if (input.apiId !== undefined) {
555
- labelValue = input.apiId;
556
- if (labelValue.length <= 0) {
557
- throw new Error("Empty value provided for input HTTP label: apiId.");
558
- }
559
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
560
- }
561
- else {
562
- throw new Error("No value provided for input HTTP label: apiId.");
563
- }
564
- if (input.typeName !== undefined) {
565
- labelValue = input.typeName;
566
- if (labelValue.length <= 0) {
567
- throw new Error("Empty value provided for input HTTP label: typeName.");
568
- }
569
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
570
- }
571
- else {
572
- throw new Error("No value provided for input HTTP label: typeName.");
573
- }
574
- if (input.fieldName !== undefined) {
575
- labelValue = input.fieldName;
576
- if (labelValue.length <= 0) {
577
- throw new Error("Empty value provided for input HTTP label: fieldName.");
578
- }
579
- resolvedPath = resolvedPath.replace("{fieldName}", __extendedEncodeURIComponent(labelValue));
580
- }
581
- else {
582
- throw new Error("No value provided for input HTTP label: fieldName.");
583
- }
401
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
402
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
403
+ resolvedPath = __resolvedPath(resolvedPath, input, "fieldName", function () { return input.fieldName; }, "{fieldName}", false);
584
404
  return [2, new __HttpRequest({
585
405
  protocol: protocol,
586
406
  hostname: hostname,
@@ -594,7 +414,7 @@ export var serializeAws_restJson1DeleteResolverCommand = function (input, contex
594
414
  });
595
415
  }); };
596
416
  export var serializeAws_restJson1DeleteTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
597
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
417
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
598
418
  return __generator(this, function (_c) {
599
419
  switch (_c.label) {
600
420
  case 0: return [4, context.endpoint()];
@@ -602,26 +422,8 @@ export var serializeAws_restJson1DeleteTypeCommand = function (input, context) {
602
422
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
603
423
  headers = {};
604
424
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/types/{typeName}";
605
- if (input.apiId !== undefined) {
606
- labelValue = input.apiId;
607
- if (labelValue.length <= 0) {
608
- throw new Error("Empty value provided for input HTTP label: apiId.");
609
- }
610
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
611
- }
612
- else {
613
- throw new Error("No value provided for input HTTP label: apiId.");
614
- }
615
- if (input.typeName !== undefined) {
616
- labelValue = input.typeName;
617
- if (labelValue.length <= 0) {
618
- throw new Error("Empty value provided for input HTTP label: typeName.");
619
- }
620
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
621
- }
622
- else {
623
- throw new Error("No value provided for input HTTP label: typeName.");
624
- }
425
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
426
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
625
427
  return [2, new __HttpRequest({
626
428
  protocol: protocol,
627
429
  hostname: hostname,
@@ -635,7 +437,7 @@ export var serializeAws_restJson1DeleteTypeCommand = function (input, context) {
635
437
  });
636
438
  }); };
637
439
  export var serializeAws_restJson1DisassociateApiCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
638
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
440
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
639
441
  return __generator(this, function (_c) {
640
442
  switch (_c.label) {
641
443
  case 0: return [4, context.endpoint()];
@@ -644,16 +446,7 @@ export var serializeAws_restJson1DisassociateApiCommand = function (input, conte
644
446
  headers = {};
645
447
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
646
448
  "/v1/domainnames/{domainName}/apiassociation";
647
- if (input.domainName !== undefined) {
648
- labelValue = input.domainName;
649
- if (labelValue.length <= 0) {
650
- throw new Error("Empty value provided for input HTTP label: domainName.");
651
- }
652
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
653
- }
654
- else {
655
- throw new Error("No value provided for input HTTP label: domainName.");
656
- }
449
+ resolvedPath = __resolvedPath(resolvedPath, input, "domainName", function () { return input.domainName; }, "{domainName}", false);
657
450
  return [2, new __HttpRequest({
658
451
  protocol: protocol,
659
452
  hostname: hostname,
@@ -691,7 +484,7 @@ export var serializeAws_restJson1EvaluateMappingTemplateCommand = function (inpu
691
484
  });
692
485
  }); };
693
486
  export var serializeAws_restJson1FlushApiCacheCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
694
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
487
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
695
488
  return __generator(this, function (_c) {
696
489
  switch (_c.label) {
697
490
  case 0: return [4, context.endpoint()];
@@ -699,16 +492,7 @@ export var serializeAws_restJson1FlushApiCacheCommand = function (input, context
699
492
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
700
493
  headers = {};
701
494
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/FlushCache";
702
- if (input.apiId !== undefined) {
703
- labelValue = input.apiId;
704
- if (labelValue.length <= 0) {
705
- throw new Error("Empty value provided for input HTTP label: apiId.");
706
- }
707
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
708
- }
709
- else {
710
- throw new Error("No value provided for input HTTP label: apiId.");
711
- }
495
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
712
496
  return [2, new __HttpRequest({
713
497
  protocol: protocol,
714
498
  hostname: hostname,
@@ -722,7 +506,7 @@ export var serializeAws_restJson1FlushApiCacheCommand = function (input, context
722
506
  });
723
507
  }); };
724
508
  export var serializeAws_restJson1GetApiAssociationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
725
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
509
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
726
510
  return __generator(this, function (_c) {
727
511
  switch (_c.label) {
728
512
  case 0: return [4, context.endpoint()];
@@ -731,16 +515,7 @@ export var serializeAws_restJson1GetApiAssociationCommand = function (input, con
731
515
  headers = {};
732
516
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
733
517
  "/v1/domainnames/{domainName}/apiassociation";
734
- if (input.domainName !== undefined) {
735
- labelValue = input.domainName;
736
- if (labelValue.length <= 0) {
737
- throw new Error("Empty value provided for input HTTP label: domainName.");
738
- }
739
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
740
- }
741
- else {
742
- throw new Error("No value provided for input HTTP label: domainName.");
743
- }
518
+ resolvedPath = __resolvedPath(resolvedPath, input, "domainName", function () { return input.domainName; }, "{domainName}", false);
744
519
  return [2, new __HttpRequest({
745
520
  protocol: protocol,
746
521
  hostname: hostname,
@@ -754,7 +529,7 @@ export var serializeAws_restJson1GetApiAssociationCommand = function (input, con
754
529
  });
755
530
  }); };
756
531
  export var serializeAws_restJson1GetApiCacheCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
757
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
532
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
758
533
  return __generator(this, function (_c) {
759
534
  switch (_c.label) {
760
535
  case 0: return [4, context.endpoint()];
@@ -762,16 +537,7 @@ export var serializeAws_restJson1GetApiCacheCommand = function (input, context)
762
537
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
763
538
  headers = {};
764
539
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/ApiCaches";
765
- if (input.apiId !== undefined) {
766
- labelValue = input.apiId;
767
- if (labelValue.length <= 0) {
768
- throw new Error("Empty value provided for input HTTP label: apiId.");
769
- }
770
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
771
- }
772
- else {
773
- throw new Error("No value provided for input HTTP label: apiId.");
774
- }
540
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
775
541
  return [2, new __HttpRequest({
776
542
  protocol: protocol,
777
543
  hostname: hostname,
@@ -785,7 +551,7 @@ export var serializeAws_restJson1GetApiCacheCommand = function (input, context)
785
551
  });
786
552
  }); };
787
553
  export var serializeAws_restJson1GetDataSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
788
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
554
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
789
555
  return __generator(this, function (_c) {
790
556
  switch (_c.label) {
791
557
  case 0: return [4, context.endpoint()];
@@ -793,26 +559,8 @@ export var serializeAws_restJson1GetDataSourceCommand = function (input, context
793
559
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
794
560
  headers = {};
795
561
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/datasources/{name}";
796
- if (input.apiId !== undefined) {
797
- labelValue = input.apiId;
798
- if (labelValue.length <= 0) {
799
- throw new Error("Empty value provided for input HTTP label: apiId.");
800
- }
801
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
802
- }
803
- else {
804
- throw new Error("No value provided for input HTTP label: apiId.");
805
- }
806
- if (input.name !== undefined) {
807
- labelValue = input.name;
808
- if (labelValue.length <= 0) {
809
- throw new Error("Empty value provided for input HTTP label: name.");
810
- }
811
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
812
- }
813
- else {
814
- throw new Error("No value provided for input HTTP label: name.");
815
- }
562
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
563
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
816
564
  return [2, new __HttpRequest({
817
565
  protocol: protocol,
818
566
  hostname: hostname,
@@ -826,7 +574,7 @@ export var serializeAws_restJson1GetDataSourceCommand = function (input, context
826
574
  });
827
575
  }); };
828
576
  export var serializeAws_restJson1GetDomainNameCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
829
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
577
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
830
578
  return __generator(this, function (_c) {
831
579
  switch (_c.label) {
832
580
  case 0: return [4, context.endpoint()];
@@ -834,16 +582,7 @@ export var serializeAws_restJson1GetDomainNameCommand = function (input, context
834
582
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
835
583
  headers = {};
836
584
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/domainnames/{domainName}";
837
- if (input.domainName !== undefined) {
838
- labelValue = input.domainName;
839
- if (labelValue.length <= 0) {
840
- throw new Error("Empty value provided for input HTTP label: domainName.");
841
- }
842
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
843
- }
844
- else {
845
- throw new Error("No value provided for input HTTP label: domainName.");
846
- }
585
+ resolvedPath = __resolvedPath(resolvedPath, input, "domainName", function () { return input.domainName; }, "{domainName}", false);
847
586
  return [2, new __HttpRequest({
848
587
  protocol: protocol,
849
588
  hostname: hostname,
@@ -857,7 +596,7 @@ export var serializeAws_restJson1GetDomainNameCommand = function (input, context
857
596
  });
858
597
  }); };
859
598
  export var serializeAws_restJson1GetFunctionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
860
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
599
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
861
600
  return __generator(this, function (_c) {
862
601
  switch (_c.label) {
863
602
  case 0: return [4, context.endpoint()];
@@ -865,26 +604,8 @@ export var serializeAws_restJson1GetFunctionCommand = function (input, context)
865
604
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
866
605
  headers = {};
867
606
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/functions/{functionId}";
868
- if (input.apiId !== undefined) {
869
- labelValue = input.apiId;
870
- if (labelValue.length <= 0) {
871
- throw new Error("Empty value provided for input HTTP label: apiId.");
872
- }
873
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
874
- }
875
- else {
876
- throw new Error("No value provided for input HTTP label: apiId.");
877
- }
878
- if (input.functionId !== undefined) {
879
- labelValue = input.functionId;
880
- if (labelValue.length <= 0) {
881
- throw new Error("Empty value provided for input HTTP label: functionId.");
882
- }
883
- resolvedPath = resolvedPath.replace("{functionId}", __extendedEncodeURIComponent(labelValue));
884
- }
885
- else {
886
- throw new Error("No value provided for input HTTP label: functionId.");
887
- }
607
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
608
+ resolvedPath = __resolvedPath(resolvedPath, input, "functionId", function () { return input.functionId; }, "{functionId}", false);
888
609
  return [2, new __HttpRequest({
889
610
  protocol: protocol,
890
611
  hostname: hostname,
@@ -898,7 +619,7 @@ export var serializeAws_restJson1GetFunctionCommand = function (input, context)
898
619
  });
899
620
  }); };
900
621
  export var serializeAws_restJson1GetGraphqlApiCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
901
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
622
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
902
623
  return __generator(this, function (_c) {
903
624
  switch (_c.label) {
904
625
  case 0: return [4, context.endpoint()];
@@ -906,16 +627,7 @@ export var serializeAws_restJson1GetGraphqlApiCommand = function (input, context
906
627
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
907
628
  headers = {};
908
629
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}";
909
- if (input.apiId !== undefined) {
910
- labelValue = input.apiId;
911
- if (labelValue.length <= 0) {
912
- throw new Error("Empty value provided for input HTTP label: apiId.");
913
- }
914
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
915
- }
916
- else {
917
- throw new Error("No value provided for input HTTP label: apiId.");
918
- }
630
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
919
631
  return [2, new __HttpRequest({
920
632
  protocol: protocol,
921
633
  hostname: hostname,
@@ -929,7 +641,7 @@ export var serializeAws_restJson1GetGraphqlApiCommand = function (input, context
929
641
  });
930
642
  }); };
931
643
  export var serializeAws_restJson1GetIntrospectionSchemaCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
932
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
644
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
933
645
  return __generator(this, function (_c) {
934
646
  switch (_c.label) {
935
647
  case 0: return [4, context.endpoint()];
@@ -937,17 +649,11 @@ export var serializeAws_restJson1GetIntrospectionSchemaCommand = function (input
937
649
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
938
650
  headers = {};
939
651
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/schema";
940
- if (input.apiId !== undefined) {
941
- labelValue = input.apiId;
942
- if (labelValue.length <= 0) {
943
- throw new Error("Empty value provided for input HTTP label: apiId.");
944
- }
945
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
946
- }
947
- else {
948
- throw new Error("No value provided for input HTTP label: apiId.");
949
- }
950
- query = __assign(__assign({}, (input.format !== undefined && { format: input.format })), (input.includeDirectives !== undefined && { includeDirectives: input.includeDirectives.toString() }));
652
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
653
+ query = map({
654
+ format: [, input.format],
655
+ includeDirectives: [function () { return input.includeDirectives !== void 0; }, function () { return input.includeDirectives.toString(); }],
656
+ });
951
657
  return [2, new __HttpRequest({
952
658
  protocol: protocol,
953
659
  hostname: hostname,
@@ -962,7 +668,7 @@ export var serializeAws_restJson1GetIntrospectionSchemaCommand = function (input
962
668
  });
963
669
  }); };
964
670
  export var serializeAws_restJson1GetResolverCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
965
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
671
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
966
672
  return __generator(this, function (_c) {
967
673
  switch (_c.label) {
968
674
  case 0: return [4, context.endpoint()];
@@ -971,36 +677,9 @@ export var serializeAws_restJson1GetResolverCommand = function (input, context)
971
677
  headers = {};
972
678
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
973
679
  "/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}";
974
- if (input.apiId !== undefined) {
975
- labelValue = input.apiId;
976
- if (labelValue.length <= 0) {
977
- throw new Error("Empty value provided for input HTTP label: apiId.");
978
- }
979
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
980
- }
981
- else {
982
- throw new Error("No value provided for input HTTP label: apiId.");
983
- }
984
- if (input.typeName !== undefined) {
985
- labelValue = input.typeName;
986
- if (labelValue.length <= 0) {
987
- throw new Error("Empty value provided for input HTTP label: typeName.");
988
- }
989
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
990
- }
991
- else {
992
- throw new Error("No value provided for input HTTP label: typeName.");
993
- }
994
- if (input.fieldName !== undefined) {
995
- labelValue = input.fieldName;
996
- if (labelValue.length <= 0) {
997
- throw new Error("Empty value provided for input HTTP label: fieldName.");
998
- }
999
- resolvedPath = resolvedPath.replace("{fieldName}", __extendedEncodeURIComponent(labelValue));
1000
- }
1001
- else {
1002
- throw new Error("No value provided for input HTTP label: fieldName.");
1003
- }
680
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
681
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
682
+ resolvedPath = __resolvedPath(resolvedPath, input, "fieldName", function () { return input.fieldName; }, "{fieldName}", false);
1004
683
  return [2, new __HttpRequest({
1005
684
  protocol: protocol,
1006
685
  hostname: hostname,
@@ -1014,7 +693,7 @@ export var serializeAws_restJson1GetResolverCommand = function (input, context)
1014
693
  });
1015
694
  }); };
1016
695
  export var serializeAws_restJson1GetSchemaCreationStatusCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1017
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
696
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1018
697
  return __generator(this, function (_c) {
1019
698
  switch (_c.label) {
1020
699
  case 0: return [4, context.endpoint()];
@@ -1022,16 +701,7 @@ export var serializeAws_restJson1GetSchemaCreationStatusCommand = function (inpu
1022
701
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1023
702
  headers = {};
1024
703
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/schemacreation";
1025
- if (input.apiId !== undefined) {
1026
- labelValue = input.apiId;
1027
- if (labelValue.length <= 0) {
1028
- throw new Error("Empty value provided for input HTTP label: apiId.");
1029
- }
1030
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1031
- }
1032
- else {
1033
- throw new Error("No value provided for input HTTP label: apiId.");
1034
- }
704
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1035
705
  return [2, new __HttpRequest({
1036
706
  protocol: protocol,
1037
707
  hostname: hostname,
@@ -1045,7 +715,7 @@ export var serializeAws_restJson1GetSchemaCreationStatusCommand = function (inpu
1045
715
  });
1046
716
  }); };
1047
717
  export var serializeAws_restJson1GetTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1048
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
718
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1049
719
  return __generator(this, function (_c) {
1050
720
  switch (_c.label) {
1051
721
  case 0: return [4, context.endpoint()];
@@ -1053,27 +723,11 @@ export var serializeAws_restJson1GetTypeCommand = function (input, context) { re
1053
723
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1054
724
  headers = {};
1055
725
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/types/{typeName}";
1056
- if (input.apiId !== undefined) {
1057
- labelValue = input.apiId;
1058
- if (labelValue.length <= 0) {
1059
- throw new Error("Empty value provided for input HTTP label: apiId.");
1060
- }
1061
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1062
- }
1063
- else {
1064
- throw new Error("No value provided for input HTTP label: apiId.");
1065
- }
1066
- if (input.typeName !== undefined) {
1067
- labelValue = input.typeName;
1068
- if (labelValue.length <= 0) {
1069
- throw new Error("Empty value provided for input HTTP label: typeName.");
1070
- }
1071
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
1072
- }
1073
- else {
1074
- throw new Error("No value provided for input HTTP label: typeName.");
1075
- }
1076
- query = __assign({}, (input.format !== undefined && { format: input.format }));
726
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
727
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
728
+ query = map({
729
+ format: [, input.format],
730
+ });
1077
731
  return [2, new __HttpRequest({
1078
732
  protocol: protocol,
1079
733
  hostname: hostname,
@@ -1088,7 +742,7 @@ export var serializeAws_restJson1GetTypeCommand = function (input, context) { re
1088
742
  });
1089
743
  }); };
1090
744
  export var serializeAws_restJson1ListApiKeysCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1091
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
745
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1092
746
  return __generator(this, function (_c) {
1093
747
  switch (_c.label) {
1094
748
  case 0: return [4, context.endpoint()];
@@ -1096,17 +750,11 @@ export var serializeAws_restJson1ListApiKeysCommand = function (input, context)
1096
750
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1097
751
  headers = {};
1098
752
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/apikeys";
1099
- if (input.apiId !== undefined) {
1100
- labelValue = input.apiId;
1101
- if (labelValue.length <= 0) {
1102
- throw new Error("Empty value provided for input HTTP label: apiId.");
1103
- }
1104
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1105
- }
1106
- else {
1107
- throw new Error("No value provided for input HTTP label: apiId.");
1108
- }
1109
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
753
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
754
+ query = map({
755
+ nextToken: [, input.nextToken],
756
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
757
+ });
1110
758
  return [2, new __HttpRequest({
1111
759
  protocol: protocol,
1112
760
  hostname: hostname,
@@ -1121,7 +769,7 @@ export var serializeAws_restJson1ListApiKeysCommand = function (input, context)
1121
769
  });
1122
770
  }); };
1123
771
  export var serializeAws_restJson1ListDataSourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1124
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
772
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1125
773
  return __generator(this, function (_c) {
1126
774
  switch (_c.label) {
1127
775
  case 0: return [4, context.endpoint()];
@@ -1129,17 +777,11 @@ export var serializeAws_restJson1ListDataSourcesCommand = function (input, conte
1129
777
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1130
778
  headers = {};
1131
779
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/datasources";
1132
- if (input.apiId !== undefined) {
1133
- labelValue = input.apiId;
1134
- if (labelValue.length <= 0) {
1135
- throw new Error("Empty value provided for input HTTP label: apiId.");
1136
- }
1137
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1138
- }
1139
- else {
1140
- throw new Error("No value provided for input HTTP label: apiId.");
1141
- }
1142
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
780
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
781
+ query = map({
782
+ nextToken: [, input.nextToken],
783
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
784
+ });
1143
785
  return [2, new __HttpRequest({
1144
786
  protocol: protocol,
1145
787
  hostname: hostname,
@@ -1162,7 +804,10 @@ export var serializeAws_restJson1ListDomainNamesCommand = function (input, conte
1162
804
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1163
805
  headers = {};
1164
806
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/domainnames";
1165
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
807
+ query = map({
808
+ nextToken: [, input.nextToken],
809
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
810
+ });
1166
811
  return [2, new __HttpRequest({
1167
812
  protocol: protocol,
1168
813
  hostname: hostname,
@@ -1177,7 +822,7 @@ export var serializeAws_restJson1ListDomainNamesCommand = function (input, conte
1177
822
  });
1178
823
  }); };
1179
824
  export var serializeAws_restJson1ListFunctionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1180
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
825
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1181
826
  return __generator(this, function (_c) {
1182
827
  switch (_c.label) {
1183
828
  case 0: return [4, context.endpoint()];
@@ -1185,17 +830,11 @@ export var serializeAws_restJson1ListFunctionsCommand = function (input, context
1185
830
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1186
831
  headers = {};
1187
832
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/functions";
1188
- if (input.apiId !== undefined) {
1189
- labelValue = input.apiId;
1190
- if (labelValue.length <= 0) {
1191
- throw new Error("Empty value provided for input HTTP label: apiId.");
1192
- }
1193
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1194
- }
1195
- else {
1196
- throw new Error("No value provided for input HTTP label: apiId.");
1197
- }
1198
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
833
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
834
+ query = map({
835
+ nextToken: [, input.nextToken],
836
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
837
+ });
1199
838
  return [2, new __HttpRequest({
1200
839
  protocol: protocol,
1201
840
  hostname: hostname,
@@ -1218,7 +857,10 @@ export var serializeAws_restJson1ListGraphqlApisCommand = function (input, conte
1218
857
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1219
858
  headers = {};
1220
859
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis";
1221
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
860
+ query = map({
861
+ nextToken: [, input.nextToken],
862
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
863
+ });
1222
864
  return [2, new __HttpRequest({
1223
865
  protocol: protocol,
1224
866
  hostname: hostname,
@@ -1233,7 +875,7 @@ export var serializeAws_restJson1ListGraphqlApisCommand = function (input, conte
1233
875
  });
1234
876
  }); };
1235
877
  export var serializeAws_restJson1ListResolversCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1236
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
878
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1237
879
  return __generator(this, function (_c) {
1238
880
  switch (_c.label) {
1239
881
  case 0: return [4, context.endpoint()];
@@ -1242,27 +884,12 @@ export var serializeAws_restJson1ListResolversCommand = function (input, context
1242
884
  headers = {};
1243
885
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1244
886
  "/v1/apis/{apiId}/types/{typeName}/resolvers";
1245
- if (input.apiId !== undefined) {
1246
- labelValue = input.apiId;
1247
- if (labelValue.length <= 0) {
1248
- throw new Error("Empty value provided for input HTTP label: apiId.");
1249
- }
1250
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1251
- }
1252
- else {
1253
- throw new Error("No value provided for input HTTP label: apiId.");
1254
- }
1255
- if (input.typeName !== undefined) {
1256
- labelValue = input.typeName;
1257
- if (labelValue.length <= 0) {
1258
- throw new Error("Empty value provided for input HTTP label: typeName.");
1259
- }
1260
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
1261
- }
1262
- else {
1263
- throw new Error("No value provided for input HTTP label: typeName.");
1264
- }
1265
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
887
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
888
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
889
+ query = map({
890
+ nextToken: [, input.nextToken],
891
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
892
+ });
1266
893
  return [2, new __HttpRequest({
1267
894
  protocol: protocol,
1268
895
  hostname: hostname,
@@ -1277,7 +904,7 @@ export var serializeAws_restJson1ListResolversCommand = function (input, context
1277
904
  });
1278
905
  }); };
1279
906
  export var serializeAws_restJson1ListResolversByFunctionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1280
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
907
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1281
908
  return __generator(this, function (_c) {
1282
909
  switch (_c.label) {
1283
910
  case 0: return [4, context.endpoint()];
@@ -1286,27 +913,12 @@ export var serializeAws_restJson1ListResolversByFunctionCommand = function (inpu
1286
913
  headers = {};
1287
914
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1288
915
  "/v1/apis/{apiId}/functions/{functionId}/resolvers";
1289
- if (input.apiId !== undefined) {
1290
- labelValue = input.apiId;
1291
- if (labelValue.length <= 0) {
1292
- throw new Error("Empty value provided for input HTTP label: apiId.");
1293
- }
1294
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1295
- }
1296
- else {
1297
- throw new Error("No value provided for input HTTP label: apiId.");
1298
- }
1299
- if (input.functionId !== undefined) {
1300
- labelValue = input.functionId;
1301
- if (labelValue.length <= 0) {
1302
- throw new Error("Empty value provided for input HTTP label: functionId.");
1303
- }
1304
- resolvedPath = resolvedPath.replace("{functionId}", __extendedEncodeURIComponent(labelValue));
1305
- }
1306
- else {
1307
- throw new Error("No value provided for input HTTP label: functionId.");
1308
- }
1309
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
916
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
917
+ resolvedPath = __resolvedPath(resolvedPath, input, "functionId", function () { return input.functionId; }, "{functionId}", false);
918
+ query = map({
919
+ nextToken: [, input.nextToken],
920
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
921
+ });
1310
922
  return [2, new __HttpRequest({
1311
923
  protocol: protocol,
1312
924
  hostname: hostname,
@@ -1321,7 +933,7 @@ export var serializeAws_restJson1ListResolversByFunctionCommand = function (inpu
1321
933
  });
1322
934
  }); };
1323
935
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1324
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
936
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1325
937
  return __generator(this, function (_c) {
1326
938
  switch (_c.label) {
1327
939
  case 0: return [4, context.endpoint()];
@@ -1329,16 +941,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
1329
941
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1330
942
  headers = {};
1331
943
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{resourceArn}";
1332
- if (input.resourceArn !== undefined) {
1333
- labelValue = input.resourceArn;
1334
- if (labelValue.length <= 0) {
1335
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1336
- }
1337
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
1338
- }
1339
- else {
1340
- throw new Error("No value provided for input HTTP label: resourceArn.");
1341
- }
944
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
1342
945
  return [2, new __HttpRequest({
1343
946
  protocol: protocol,
1344
947
  hostname: hostname,
@@ -1352,7 +955,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
1352
955
  });
1353
956
  }); };
1354
957
  export var serializeAws_restJson1ListTypesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1355
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
958
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1356
959
  return __generator(this, function (_c) {
1357
960
  switch (_c.label) {
1358
961
  case 0: return [4, context.endpoint()];
@@ -1360,17 +963,12 @@ export var serializeAws_restJson1ListTypesCommand = function (input, context) {
1360
963
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1361
964
  headers = {};
1362
965
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/types";
1363
- if (input.apiId !== undefined) {
1364
- labelValue = input.apiId;
1365
- if (labelValue.length <= 0) {
1366
- throw new Error("Empty value provided for input HTTP label: apiId.");
1367
- }
1368
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1369
- }
1370
- else {
1371
- throw new Error("No value provided for input HTTP label: apiId.");
1372
- }
1373
- query = __assign(__assign(__assign({}, (input.format !== undefined && { format: input.format })), (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
966
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
967
+ query = map({
968
+ format: [, input.format],
969
+ nextToken: [, input.nextToken],
970
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
971
+ });
1374
972
  return [2, new __HttpRequest({
1375
973
  protocol: protocol,
1376
974
  hostname: hostname,
@@ -1385,7 +983,7 @@ export var serializeAws_restJson1ListTypesCommand = function (input, context) {
1385
983
  });
1386
984
  }); };
1387
985
  export var serializeAws_restJson1StartSchemaCreationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1388
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
986
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1389
987
  return __generator(this, function (_c) {
1390
988
  switch (_c.label) {
1391
989
  case 0: return [4, context.endpoint()];
@@ -1395,16 +993,7 @@ export var serializeAws_restJson1StartSchemaCreationCommand = function (input, c
1395
993
  "content-type": "application/json",
1396
994
  };
1397
995
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/schemacreation";
1398
- if (input.apiId !== undefined) {
1399
- labelValue = input.apiId;
1400
- if (labelValue.length <= 0) {
1401
- throw new Error("Empty value provided for input HTTP label: apiId.");
1402
- }
1403
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1404
- }
1405
- else {
1406
- throw new Error("No value provided for input HTTP label: apiId.");
1407
- }
996
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1408
997
  body = JSON.stringify(__assign({}, (input.definition != null && { definition: context.base64Encoder(input.definition) })));
1409
998
  return [2, new __HttpRequest({
1410
999
  protocol: protocol,
@@ -1419,7 +1008,7 @@ export var serializeAws_restJson1StartSchemaCreationCommand = function (input, c
1419
1008
  });
1420
1009
  }); };
1421
1010
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1422
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
1011
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1423
1012
  return __generator(this, function (_c) {
1424
1013
  switch (_c.label) {
1425
1014
  case 0: return [4, context.endpoint()];
@@ -1429,16 +1018,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
1429
1018
  "content-type": "application/json",
1430
1019
  };
1431
1020
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{resourceArn}";
1432
- if (input.resourceArn !== undefined) {
1433
- labelValue = input.resourceArn;
1434
- if (labelValue.length <= 0) {
1435
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1436
- }
1437
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
1438
- }
1439
- else {
1440
- throw new Error("No value provided for input HTTP label: resourceArn.");
1441
- }
1021
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
1442
1022
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
1443
1023
  return [2, new __HttpRequest({
1444
1024
  protocol: protocol,
@@ -1453,7 +1033,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
1453
1033
  });
1454
1034
  }); };
1455
1035
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1456
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
1036
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1457
1037
  return __generator(this, function (_c) {
1458
1038
  switch (_c.label) {
1459
1039
  case 0: return [4, context.endpoint()];
@@ -1461,17 +1041,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1461
1041
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1462
1042
  headers = {};
1463
1043
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/tags/{resourceArn}";
1464
- if (input.resourceArn !== undefined) {
1465
- labelValue = input.resourceArn;
1466
- if (labelValue.length <= 0) {
1467
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1468
- }
1469
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
1470
- }
1471
- else {
1472
- throw new Error("No value provided for input HTTP label: resourceArn.");
1473
- }
1474
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
1044
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
1045
+ query = map({
1046
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
1047
+ });
1475
1048
  return [2, new __HttpRequest({
1476
1049
  protocol: protocol,
1477
1050
  hostname: hostname,
@@ -1486,7 +1059,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1486
1059
  });
1487
1060
  }); };
1488
1061
  export var serializeAws_restJson1UpdateApiCacheCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1489
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
1062
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1490
1063
  return __generator(this, function (_c) {
1491
1064
  switch (_c.label) {
1492
1065
  case 0: return [4, context.endpoint()];
@@ -1496,16 +1069,7 @@ export var serializeAws_restJson1UpdateApiCacheCommand = function (input, contex
1496
1069
  "content-type": "application/json",
1497
1070
  };
1498
1071
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/ApiCaches/update";
1499
- if (input.apiId !== undefined) {
1500
- labelValue = input.apiId;
1501
- if (labelValue.length <= 0) {
1502
- throw new Error("Empty value provided for input HTTP label: apiId.");
1503
- }
1504
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1505
- }
1506
- else {
1507
- throw new Error("No value provided for input HTTP label: apiId.");
1508
- }
1072
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1509
1073
  body = JSON.stringify(__assign(__assign(__assign({}, (input.apiCachingBehavior != null && { apiCachingBehavior: input.apiCachingBehavior })), (input.ttl != null && { ttl: input.ttl })), (input.type != null && { type: input.type })));
1510
1074
  return [2, new __HttpRequest({
1511
1075
  protocol: protocol,
@@ -1520,7 +1084,7 @@ export var serializeAws_restJson1UpdateApiCacheCommand = function (input, contex
1520
1084
  });
1521
1085
  }); };
1522
1086
  export var serializeAws_restJson1UpdateApiKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1523
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
1087
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1524
1088
  return __generator(this, function (_c) {
1525
1089
  switch (_c.label) {
1526
1090
  case 0: return [4, context.endpoint()];
@@ -1530,26 +1094,8 @@ export var serializeAws_restJson1UpdateApiKeyCommand = function (input, context)
1530
1094
  "content-type": "application/json",
1531
1095
  };
1532
1096
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/apikeys/{id}";
1533
- if (input.apiId !== undefined) {
1534
- labelValue = input.apiId;
1535
- if (labelValue.length <= 0) {
1536
- throw new Error("Empty value provided for input HTTP label: apiId.");
1537
- }
1538
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1539
- }
1540
- else {
1541
- throw new Error("No value provided for input HTTP label: apiId.");
1542
- }
1543
- if (input.id !== undefined) {
1544
- labelValue = input.id;
1545
- if (labelValue.length <= 0) {
1546
- throw new Error("Empty value provided for input HTTP label: id.");
1547
- }
1548
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
1549
- }
1550
- else {
1551
- throw new Error("No value provided for input HTTP label: id.");
1552
- }
1097
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1098
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
1553
1099
  body = JSON.stringify(__assign(__assign({}, (input.description != null && { description: input.description })), (input.expires != null && { expires: input.expires })));
1554
1100
  return [2, new __HttpRequest({
1555
1101
  protocol: protocol,
@@ -1564,7 +1110,7 @@ export var serializeAws_restJson1UpdateApiKeyCommand = function (input, context)
1564
1110
  });
1565
1111
  }); };
1566
1112
  export var serializeAws_restJson1UpdateDataSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1567
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
1113
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1568
1114
  return __generator(this, function (_c) {
1569
1115
  switch (_c.label) {
1570
1116
  case 0: return [4, context.endpoint()];
@@ -1574,26 +1120,8 @@ export var serializeAws_restJson1UpdateDataSourceCommand = function (input, cont
1574
1120
  "content-type": "application/json",
1575
1121
  };
1576
1122
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/datasources/{name}";
1577
- if (input.apiId !== undefined) {
1578
- labelValue = input.apiId;
1579
- if (labelValue.length <= 0) {
1580
- throw new Error("Empty value provided for input HTTP label: apiId.");
1581
- }
1582
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1583
- }
1584
- else {
1585
- throw new Error("No value provided for input HTTP label: apiId.");
1586
- }
1587
- if (input.name !== undefined) {
1588
- labelValue = input.name;
1589
- if (labelValue.length <= 0) {
1590
- throw new Error("Empty value provided for input HTTP label: name.");
1591
- }
1592
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
1593
- }
1594
- else {
1595
- throw new Error("No value provided for input HTTP label: name.");
1596
- }
1123
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1124
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
1597
1125
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.dynamodbConfig != null && {
1598
1126
  dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context),
1599
1127
  })), (input.elasticsearchConfig != null && {
@@ -1620,7 +1148,7 @@ export var serializeAws_restJson1UpdateDataSourceCommand = function (input, cont
1620
1148
  });
1621
1149
  }); };
1622
1150
  export var serializeAws_restJson1UpdateDomainNameCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1623
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
1151
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1624
1152
  return __generator(this, function (_c) {
1625
1153
  switch (_c.label) {
1626
1154
  case 0: return [4, context.endpoint()];
@@ -1630,16 +1158,7 @@ export var serializeAws_restJson1UpdateDomainNameCommand = function (input, cont
1630
1158
  "content-type": "application/json",
1631
1159
  };
1632
1160
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/domainnames/{domainName}";
1633
- if (input.domainName !== undefined) {
1634
- labelValue = input.domainName;
1635
- if (labelValue.length <= 0) {
1636
- throw new Error("Empty value provided for input HTTP label: domainName.");
1637
- }
1638
- resolvedPath = resolvedPath.replace("{domainName}", __extendedEncodeURIComponent(labelValue));
1639
- }
1640
- else {
1641
- throw new Error("No value provided for input HTTP label: domainName.");
1642
- }
1161
+ resolvedPath = __resolvedPath(resolvedPath, input, "domainName", function () { return input.domainName; }, "{domainName}", false);
1643
1162
  body = JSON.stringify(__assign({}, (input.description != null && { description: input.description })));
1644
1163
  return [2, new __HttpRequest({
1645
1164
  protocol: protocol,
@@ -1654,7 +1173,7 @@ export var serializeAws_restJson1UpdateDomainNameCommand = function (input, cont
1654
1173
  });
1655
1174
  }); };
1656
1175
  export var serializeAws_restJson1UpdateFunctionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1657
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
1176
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1658
1177
  return __generator(this, function (_c) {
1659
1178
  switch (_c.label) {
1660
1179
  case 0: return [4, context.endpoint()];
@@ -1664,26 +1183,8 @@ export var serializeAws_restJson1UpdateFunctionCommand = function (input, contex
1664
1183
  "content-type": "application/json",
1665
1184
  };
1666
1185
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/functions/{functionId}";
1667
- if (input.apiId !== undefined) {
1668
- labelValue = input.apiId;
1669
- if (labelValue.length <= 0) {
1670
- throw new Error("Empty value provided for input HTTP label: apiId.");
1671
- }
1672
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1673
- }
1674
- else {
1675
- throw new Error("No value provided for input HTTP label: apiId.");
1676
- }
1677
- if (input.functionId !== undefined) {
1678
- labelValue = input.functionId;
1679
- if (labelValue.length <= 0) {
1680
- throw new Error("Empty value provided for input HTTP label: functionId.");
1681
- }
1682
- resolvedPath = resolvedPath.replace("{functionId}", __extendedEncodeURIComponent(labelValue));
1683
- }
1684
- else {
1685
- throw new Error("No value provided for input HTTP label: functionId.");
1686
- }
1186
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1187
+ resolvedPath = __resolvedPath(resolvedPath, input, "functionId", function () { return input.functionId; }, "{functionId}", false);
1687
1188
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.dataSourceName != null && { dataSourceName: input.dataSourceName })), (input.description != null && { description: input.description })), (input.functionVersion != null && { functionVersion: input.functionVersion })), (input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize })), (input.name != null && { name: input.name })), (input.requestMappingTemplate != null && { requestMappingTemplate: input.requestMappingTemplate })), (input.responseMappingTemplate != null && { responseMappingTemplate: input.responseMappingTemplate })), (input.syncConfig != null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) })));
1688
1189
  return [2, new __HttpRequest({
1689
1190
  protocol: protocol,
@@ -1698,7 +1199,7 @@ export var serializeAws_restJson1UpdateFunctionCommand = function (input, contex
1698
1199
  });
1699
1200
  }); };
1700
1201
  export var serializeAws_restJson1UpdateGraphqlApiCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1701
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
1202
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1702
1203
  return __generator(this, function (_c) {
1703
1204
  switch (_c.label) {
1704
1205
  case 0: return [4, context.endpoint()];
@@ -1708,16 +1209,7 @@ export var serializeAws_restJson1UpdateGraphqlApiCommand = function (input, cont
1708
1209
  "content-type": "application/json",
1709
1210
  };
1710
1211
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}";
1711
- if (input.apiId !== undefined) {
1712
- labelValue = input.apiId;
1713
- if (labelValue.length <= 0) {
1714
- throw new Error("Empty value provided for input HTTP label: apiId.");
1715
- }
1716
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1717
- }
1718
- else {
1719
- throw new Error("No value provided for input HTTP label: apiId.");
1720
- }
1212
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1721
1213
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.additionalAuthenticationProviders != null && {
1722
1214
  additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders(input.additionalAuthenticationProviders, context),
1723
1215
  })), (input.authenticationType != null && { authenticationType: input.authenticationType })), (input.lambdaAuthorizerConfig != null && {
@@ -1740,7 +1232,7 @@ export var serializeAws_restJson1UpdateGraphqlApiCommand = function (input, cont
1740
1232
  });
1741
1233
  }); };
1742
1234
  export var serializeAws_restJson1UpdateResolverCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1743
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
1235
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1744
1236
  return __generator(this, function (_c) {
1745
1237
  switch (_c.label) {
1746
1238
  case 0: return [4, context.endpoint()];
@@ -1751,36 +1243,9 @@ export var serializeAws_restJson1UpdateResolverCommand = function (input, contex
1751
1243
  };
1752
1244
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1753
1245
  "/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}";
1754
- if (input.apiId !== undefined) {
1755
- labelValue = input.apiId;
1756
- if (labelValue.length <= 0) {
1757
- throw new Error("Empty value provided for input HTTP label: apiId.");
1758
- }
1759
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1760
- }
1761
- else {
1762
- throw new Error("No value provided for input HTTP label: apiId.");
1763
- }
1764
- if (input.typeName !== undefined) {
1765
- labelValue = input.typeName;
1766
- if (labelValue.length <= 0) {
1767
- throw new Error("Empty value provided for input HTTP label: typeName.");
1768
- }
1769
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
1770
- }
1771
- else {
1772
- throw new Error("No value provided for input HTTP label: typeName.");
1773
- }
1774
- if (input.fieldName !== undefined) {
1775
- labelValue = input.fieldName;
1776
- if (labelValue.length <= 0) {
1777
- throw new Error("Empty value provided for input HTTP label: fieldName.");
1778
- }
1779
- resolvedPath = resolvedPath.replace("{fieldName}", __extendedEncodeURIComponent(labelValue));
1780
- }
1781
- else {
1782
- throw new Error("No value provided for input HTTP label: fieldName.");
1783
- }
1246
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1247
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
1248
+ resolvedPath = __resolvedPath(resolvedPath, input, "fieldName", function () { return input.fieldName; }, "{fieldName}", false);
1784
1249
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.cachingConfig != null && {
1785
1250
  cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context),
1786
1251
  })), (input.dataSourceName != null && { dataSourceName: input.dataSourceName })), (input.kind != null && { kind: input.kind })), (input.maxBatchSize != null && { maxBatchSize: input.maxBatchSize })), (input.pipelineConfig != null && {
@@ -1799,7 +1264,7 @@ export var serializeAws_restJson1UpdateResolverCommand = function (input, contex
1799
1264
  });
1800
1265
  }); };
1801
1266
  export var serializeAws_restJson1UpdateTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1802
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
1267
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1803
1268
  return __generator(this, function (_c) {
1804
1269
  switch (_c.label) {
1805
1270
  case 0: return [4, context.endpoint()];
@@ -1809,26 +1274,8 @@ export var serializeAws_restJson1UpdateTypeCommand = function (input, context) {
1809
1274
  "content-type": "application/json",
1810
1275
  };
1811
1276
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/apis/{apiId}/types/{typeName}";
1812
- if (input.apiId !== undefined) {
1813
- labelValue = input.apiId;
1814
- if (labelValue.length <= 0) {
1815
- throw new Error("Empty value provided for input HTTP label: apiId.");
1816
- }
1817
- resolvedPath = resolvedPath.replace("{apiId}", __extendedEncodeURIComponent(labelValue));
1818
- }
1819
- else {
1820
- throw new Error("No value provided for input HTTP label: apiId.");
1821
- }
1822
- if (input.typeName !== undefined) {
1823
- labelValue = input.typeName;
1824
- if (labelValue.length <= 0) {
1825
- throw new Error("Empty value provided for input HTTP label: typeName.");
1826
- }
1827
- resolvedPath = resolvedPath.replace("{typeName}", __extendedEncodeURIComponent(labelValue));
1828
- }
1829
- else {
1830
- throw new Error("No value provided for input HTTP label: typeName.");
1831
- }
1277
+ resolvedPath = __resolvedPath(resolvedPath, input, "apiId", function () { return input.apiId; }, "{apiId}", false);
1278
+ resolvedPath = __resolvedPath(resolvedPath, input, "typeName", function () { return input.typeName; }, "{typeName}", false);
1832
1279
  body = JSON.stringify(__assign(__assign({}, (input.definition != null && { definition: input.definition })), (input.format != null && { format: input.format })));
1833
1280
  return [2, new __HttpRequest({
1834
1281
  protocol: protocol,
@@ -1850,24 +1297,23 @@ export var deserializeAws_restJson1AssociateApiCommand = function (output, conte
1850
1297
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1851
1298
  return [2, deserializeAws_restJson1AssociateApiCommandError(output, context)];
1852
1299
  }
1853
- contents = {
1300
+ contents = map({
1854
1301
  $metadata: deserializeMetadata(output),
1855
- apiAssociation: undefined,
1856
- };
1302
+ });
1857
1303
  _a = __expectNonNull;
1858
1304
  _b = __expectObject;
1859
1305
  return [4, parseBody(output.body, context)];
1860
1306
  case 1:
1861
1307
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1862
- if (data.apiAssociation !== undefined && data.apiAssociation !== null) {
1308
+ if (data.apiAssociation != null) {
1863
1309
  contents.apiAssociation = deserializeAws_restJson1ApiAssociation(data.apiAssociation, context);
1864
1310
  }
1865
- return [2, Promise.resolve(contents)];
1311
+ return [2, contents];
1866
1312
  }
1867
1313
  });
1868
1314
  }); };
1869
1315
  var deserializeAws_restJson1AssociateApiCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1870
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1316
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1871
1317
  var _c;
1872
1318
  return __generator(this, function (_d) {
1873
1319
  switch (_d.label) {
@@ -1900,14 +1346,14 @@ var deserializeAws_restJson1AssociateApiCommandError = function (output, context
1900
1346
  case 9: throw _d.sent();
1901
1347
  case 10:
1902
1348
  parsedBody = parsedOutput.body;
1903
- $metadata = deserializeMetadata(output);
1904
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1905
- response = new __BaseException({
1906
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1907
- $fault: "client",
1908
- $metadata: $metadata,
1349
+ throwDefaultError({
1350
+ output: output,
1351
+ parsedBody: parsedBody,
1352
+ exceptionCtor: __BaseException,
1353
+ errorCode: errorCode,
1909
1354
  });
1910
- throw __decorateServiceException(response, parsedBody);
1355
+ _d.label = 11;
1356
+ case 11: return [2];
1911
1357
  }
1912
1358
  });
1913
1359
  }); };
@@ -1919,24 +1365,23 @@ export var deserializeAws_restJson1CreateApiCacheCommand = function (output, con
1919
1365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1920
1366
  return [2, deserializeAws_restJson1CreateApiCacheCommandError(output, context)];
1921
1367
  }
1922
- contents = {
1368
+ contents = map({
1923
1369
  $metadata: deserializeMetadata(output),
1924
- apiCache: undefined,
1925
- };
1370
+ });
1926
1371
  _a = __expectNonNull;
1927
1372
  _b = __expectObject;
1928
1373
  return [4, parseBody(output.body, context)];
1929
1374
  case 1:
1930
1375
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1931
- if (data.apiCache !== undefined && data.apiCache !== null) {
1376
+ if (data.apiCache != null) {
1932
1377
  contents.apiCache = deserializeAws_restJson1ApiCache(data.apiCache, context);
1933
1378
  }
1934
- return [2, Promise.resolve(contents)];
1379
+ return [2, contents];
1935
1380
  }
1936
1381
  });
1937
1382
  }); };
1938
1383
  var deserializeAws_restJson1CreateApiCacheCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1939
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1384
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1940
1385
  var _c;
1941
1386
  return __generator(this, function (_d) {
1942
1387
  switch (_d.label) {
@@ -1973,14 +1418,14 @@ var deserializeAws_restJson1CreateApiCacheCommandError = function (output, conte
1973
1418
  case 11: throw _d.sent();
1974
1419
  case 12:
1975
1420
  parsedBody = parsedOutput.body;
1976
- $metadata = deserializeMetadata(output);
1977
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1978
- response = new __BaseException({
1979
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1980
- $fault: "client",
1981
- $metadata: $metadata,
1421
+ throwDefaultError({
1422
+ output: output,
1423
+ parsedBody: parsedBody,
1424
+ exceptionCtor: __BaseException,
1425
+ errorCode: errorCode,
1982
1426
  });
1983
- throw __decorateServiceException(response, parsedBody);
1427
+ _d.label = 13;
1428
+ case 13: return [2];
1984
1429
  }
1985
1430
  });
1986
1431
  }); };
@@ -1992,24 +1437,23 @@ export var deserializeAws_restJson1CreateApiKeyCommand = function (output, conte
1992
1437
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1993
1438
  return [2, deserializeAws_restJson1CreateApiKeyCommandError(output, context)];
1994
1439
  }
1995
- contents = {
1440
+ contents = map({
1996
1441
  $metadata: deserializeMetadata(output),
1997
- apiKey: undefined,
1998
- };
1442
+ });
1999
1443
  _a = __expectNonNull;
2000
1444
  _b = __expectObject;
2001
1445
  return [4, parseBody(output.body, context)];
2002
1446
  case 1:
2003
1447
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2004
- if (data.apiKey !== undefined && data.apiKey !== null) {
1448
+ if (data.apiKey != null) {
2005
1449
  contents.apiKey = deserializeAws_restJson1ApiKey(data.apiKey, context);
2006
1450
  }
2007
- return [2, Promise.resolve(contents)];
1451
+ return [2, contents];
2008
1452
  }
2009
1453
  });
2010
1454
  }); };
2011
1455
  var deserializeAws_restJson1CreateApiKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2012
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1456
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2013
1457
  var _c;
2014
1458
  return __generator(this, function (_d) {
2015
1459
  switch (_d.label) {
@@ -2054,14 +1498,14 @@ var deserializeAws_restJson1CreateApiKeyCommandError = function (output, context
2054
1498
  case 15: throw _d.sent();
2055
1499
  case 16:
2056
1500
  parsedBody = parsedOutput.body;
2057
- $metadata = deserializeMetadata(output);
2058
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2059
- response = new __BaseException({
2060
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2061
- $fault: "client",
2062
- $metadata: $metadata,
1501
+ throwDefaultError({
1502
+ output: output,
1503
+ parsedBody: parsedBody,
1504
+ exceptionCtor: __BaseException,
1505
+ errorCode: errorCode,
2063
1506
  });
2064
- throw __decorateServiceException(response, parsedBody);
1507
+ _d.label = 17;
1508
+ case 17: return [2];
2065
1509
  }
2066
1510
  });
2067
1511
  }); };
@@ -2073,24 +1517,23 @@ export var deserializeAws_restJson1CreateDataSourceCommand = function (output, c
2073
1517
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2074
1518
  return [2, deserializeAws_restJson1CreateDataSourceCommandError(output, context)];
2075
1519
  }
2076
- contents = {
1520
+ contents = map({
2077
1521
  $metadata: deserializeMetadata(output),
2078
- dataSource: undefined,
2079
- };
1522
+ });
2080
1523
  _a = __expectNonNull;
2081
1524
  _b = __expectObject;
2082
1525
  return [4, parseBody(output.body, context)];
2083
1526
  case 1:
2084
1527
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2085
- if (data.dataSource !== undefined && data.dataSource !== null) {
1528
+ if (data.dataSource != null) {
2086
1529
  contents.dataSource = deserializeAws_restJson1DataSource(data.dataSource, context);
2087
1530
  }
2088
- return [2, Promise.resolve(contents)];
1531
+ return [2, contents];
2089
1532
  }
2090
1533
  });
2091
1534
  }); };
2092
1535
  var deserializeAws_restJson1CreateDataSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2093
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1536
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2094
1537
  var _c;
2095
1538
  return __generator(this, function (_d) {
2096
1539
  switch (_d.label) {
@@ -2127,14 +1570,14 @@ var deserializeAws_restJson1CreateDataSourceCommandError = function (output, con
2127
1570
  case 11: throw _d.sent();
2128
1571
  case 12:
2129
1572
  parsedBody = parsedOutput.body;
2130
- $metadata = deserializeMetadata(output);
2131
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2132
- response = new __BaseException({
2133
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2134
- $fault: "client",
2135
- $metadata: $metadata,
1573
+ throwDefaultError({
1574
+ output: output,
1575
+ parsedBody: parsedBody,
1576
+ exceptionCtor: __BaseException,
1577
+ errorCode: errorCode,
2136
1578
  });
2137
- throw __decorateServiceException(response, parsedBody);
1579
+ _d.label = 13;
1580
+ case 13: return [2];
2138
1581
  }
2139
1582
  });
2140
1583
  }); };
@@ -2146,24 +1589,23 @@ export var deserializeAws_restJson1CreateDomainNameCommand = function (output, c
2146
1589
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2147
1590
  return [2, deserializeAws_restJson1CreateDomainNameCommandError(output, context)];
2148
1591
  }
2149
- contents = {
1592
+ contents = map({
2150
1593
  $metadata: deserializeMetadata(output),
2151
- domainNameConfig: undefined,
2152
- };
1594
+ });
2153
1595
  _a = __expectNonNull;
2154
1596
  _b = __expectObject;
2155
1597
  return [4, parseBody(output.body, context)];
2156
1598
  case 1:
2157
1599
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2158
- if (data.domainNameConfig !== undefined && data.domainNameConfig !== null) {
1600
+ if (data.domainNameConfig != null) {
2159
1601
  contents.domainNameConfig = deserializeAws_restJson1DomainNameConfig(data.domainNameConfig, context);
2160
1602
  }
2161
- return [2, Promise.resolve(contents)];
1603
+ return [2, contents];
2162
1604
  }
2163
1605
  });
2164
1606
  }); };
2165
1607
  var deserializeAws_restJson1CreateDomainNameCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2166
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1608
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2167
1609
  var _c;
2168
1610
  return __generator(this, function (_d) {
2169
1611
  switch (_d.label) {
@@ -2192,14 +1634,14 @@ var deserializeAws_restJson1CreateDomainNameCommandError = function (output, con
2192
1634
  case 7: throw _d.sent();
2193
1635
  case 8:
2194
1636
  parsedBody = parsedOutput.body;
2195
- $metadata = deserializeMetadata(output);
2196
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2197
- response = new __BaseException({
2198
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2199
- $fault: "client",
2200
- $metadata: $metadata,
1637
+ throwDefaultError({
1638
+ output: output,
1639
+ parsedBody: parsedBody,
1640
+ exceptionCtor: __BaseException,
1641
+ errorCode: errorCode,
2201
1642
  });
2202
- throw __decorateServiceException(response, parsedBody);
1643
+ _d.label = 9;
1644
+ case 9: return [2];
2203
1645
  }
2204
1646
  });
2205
1647
  }); };
@@ -2211,24 +1653,23 @@ export var deserializeAws_restJson1CreateFunctionCommand = function (output, con
2211
1653
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2212
1654
  return [2, deserializeAws_restJson1CreateFunctionCommandError(output, context)];
2213
1655
  }
2214
- contents = {
1656
+ contents = map({
2215
1657
  $metadata: deserializeMetadata(output),
2216
- functionConfiguration: undefined,
2217
- };
1658
+ });
2218
1659
  _a = __expectNonNull;
2219
1660
  _b = __expectObject;
2220
1661
  return [4, parseBody(output.body, context)];
2221
1662
  case 1:
2222
1663
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2223
- if (data.functionConfiguration !== undefined && data.functionConfiguration !== null) {
1664
+ if (data.functionConfiguration != null) {
2224
1665
  contents.functionConfiguration = deserializeAws_restJson1FunctionConfiguration(data.functionConfiguration, context);
2225
1666
  }
2226
- return [2, Promise.resolve(contents)];
1667
+ return [2, contents];
2227
1668
  }
2228
1669
  });
2229
1670
  }); };
2230
1671
  var deserializeAws_restJson1CreateFunctionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2231
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1672
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2232
1673
  var _c;
2233
1674
  return __generator(this, function (_d) {
2234
1675
  switch (_d.label) {
@@ -2261,14 +1702,14 @@ var deserializeAws_restJson1CreateFunctionCommandError = function (output, conte
2261
1702
  case 9: throw _d.sent();
2262
1703
  case 10:
2263
1704
  parsedBody = parsedOutput.body;
2264
- $metadata = deserializeMetadata(output);
2265
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2266
- response = new __BaseException({
2267
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2268
- $fault: "client",
2269
- $metadata: $metadata,
1705
+ throwDefaultError({
1706
+ output: output,
1707
+ parsedBody: parsedBody,
1708
+ exceptionCtor: __BaseException,
1709
+ errorCode: errorCode,
2270
1710
  });
2271
- throw __decorateServiceException(response, parsedBody);
1711
+ _d.label = 11;
1712
+ case 11: return [2];
2272
1713
  }
2273
1714
  });
2274
1715
  }); };
@@ -2280,24 +1721,23 @@ export var deserializeAws_restJson1CreateGraphqlApiCommand = function (output, c
2280
1721
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2281
1722
  return [2, deserializeAws_restJson1CreateGraphqlApiCommandError(output, context)];
2282
1723
  }
2283
- contents = {
1724
+ contents = map({
2284
1725
  $metadata: deserializeMetadata(output),
2285
- graphqlApi: undefined,
2286
- };
1726
+ });
2287
1727
  _a = __expectNonNull;
2288
1728
  _b = __expectObject;
2289
1729
  return [4, parseBody(output.body, context)];
2290
1730
  case 1:
2291
1731
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2292
- if (data.graphqlApi !== undefined && data.graphqlApi !== null) {
1732
+ if (data.graphqlApi != null) {
2293
1733
  contents.graphqlApi = deserializeAws_restJson1GraphqlApi(data.graphqlApi, context);
2294
1734
  }
2295
- return [2, Promise.resolve(contents)];
1735
+ return [2, contents];
2296
1736
  }
2297
1737
  });
2298
1738
  }); };
2299
1739
  var deserializeAws_restJson1CreateGraphqlApiCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2300
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1740
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2301
1741
  var _c;
2302
1742
  return __generator(this, function (_d) {
2303
1743
  switch (_d.label) {
@@ -2338,14 +1778,14 @@ var deserializeAws_restJson1CreateGraphqlApiCommandError = function (output, con
2338
1778
  case 13: throw _d.sent();
2339
1779
  case 14:
2340
1780
  parsedBody = parsedOutput.body;
2341
- $metadata = deserializeMetadata(output);
2342
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2343
- response = new __BaseException({
2344
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2345
- $fault: "client",
2346
- $metadata: $metadata,
1781
+ throwDefaultError({
1782
+ output: output,
1783
+ parsedBody: parsedBody,
1784
+ exceptionCtor: __BaseException,
1785
+ errorCode: errorCode,
2347
1786
  });
2348
- throw __decorateServiceException(response, parsedBody);
1787
+ _d.label = 15;
1788
+ case 15: return [2];
2349
1789
  }
2350
1790
  });
2351
1791
  }); };
@@ -2357,24 +1797,23 @@ export var deserializeAws_restJson1CreateResolverCommand = function (output, con
2357
1797
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2358
1798
  return [2, deserializeAws_restJson1CreateResolverCommandError(output, context)];
2359
1799
  }
2360
- contents = {
1800
+ contents = map({
2361
1801
  $metadata: deserializeMetadata(output),
2362
- resolver: undefined,
2363
- };
1802
+ });
2364
1803
  _a = __expectNonNull;
2365
1804
  _b = __expectObject;
2366
1805
  return [4, parseBody(output.body, context)];
2367
1806
  case 1:
2368
1807
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2369
- if (data.resolver !== undefined && data.resolver !== null) {
1808
+ if (data.resolver != null) {
2370
1809
  contents.resolver = deserializeAws_restJson1Resolver(data.resolver, context);
2371
1810
  }
2372
- return [2, Promise.resolve(contents)];
1811
+ return [2, contents];
2373
1812
  }
2374
1813
  });
2375
1814
  }); };
2376
1815
  var deserializeAws_restJson1CreateResolverCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2377
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1816
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2378
1817
  var _c;
2379
1818
  return __generator(this, function (_d) {
2380
1819
  switch (_d.label) {
@@ -2407,14 +1846,14 @@ var deserializeAws_restJson1CreateResolverCommandError = function (output, conte
2407
1846
  case 9: throw _d.sent();
2408
1847
  case 10:
2409
1848
  parsedBody = parsedOutput.body;
2410
- $metadata = deserializeMetadata(output);
2411
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2412
- response = new __BaseException({
2413
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2414
- $fault: "client",
2415
- $metadata: $metadata,
1849
+ throwDefaultError({
1850
+ output: output,
1851
+ parsedBody: parsedBody,
1852
+ exceptionCtor: __BaseException,
1853
+ errorCode: errorCode,
2416
1854
  });
2417
- throw __decorateServiceException(response, parsedBody);
1855
+ _d.label = 11;
1856
+ case 11: return [2];
2418
1857
  }
2419
1858
  });
2420
1859
  }); };
@@ -2426,24 +1865,23 @@ export var deserializeAws_restJson1CreateTypeCommand = function (output, context
2426
1865
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2427
1866
  return [2, deserializeAws_restJson1CreateTypeCommandError(output, context)];
2428
1867
  }
2429
- contents = {
1868
+ contents = map({
2430
1869
  $metadata: deserializeMetadata(output),
2431
- type: undefined,
2432
- };
1870
+ });
2433
1871
  _a = __expectNonNull;
2434
1872
  _b = __expectObject;
2435
1873
  return [4, parseBody(output.body, context)];
2436
1874
  case 1:
2437
1875
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2438
- if (data.type !== undefined && data.type !== null) {
1876
+ if (data.type != null) {
2439
1877
  contents.type = deserializeAws_restJson1Type(data.type, context);
2440
1878
  }
2441
- return [2, Promise.resolve(contents)];
1879
+ return [2, contents];
2442
1880
  }
2443
1881
  });
2444
1882
  }); };
2445
1883
  var deserializeAws_restJson1CreateTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2446
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1884
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2447
1885
  var _c;
2448
1886
  return __generator(this, function (_d) {
2449
1887
  switch (_d.label) {
@@ -2480,14 +1918,14 @@ var deserializeAws_restJson1CreateTypeCommandError = function (output, context)
2480
1918
  case 11: throw _d.sent();
2481
1919
  case 12:
2482
1920
  parsedBody = parsedOutput.body;
2483
- $metadata = deserializeMetadata(output);
2484
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2485
- response = new __BaseException({
2486
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2487
- $fault: "client",
2488
- $metadata: $metadata,
1921
+ throwDefaultError({
1922
+ output: output,
1923
+ parsedBody: parsedBody,
1924
+ exceptionCtor: __BaseException,
1925
+ errorCode: errorCode,
2489
1926
  });
2490
- throw __decorateServiceException(response, parsedBody);
1927
+ _d.label = 13;
1928
+ case 13: return [2];
2491
1929
  }
2492
1930
  });
2493
1931
  }); };
@@ -2499,18 +1937,18 @@ export var deserializeAws_restJson1DeleteApiCacheCommand = function (output, con
2499
1937
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2500
1938
  return [2, deserializeAws_restJson1DeleteApiCacheCommandError(output, context)];
2501
1939
  }
2502
- contents = {
1940
+ contents = map({
2503
1941
  $metadata: deserializeMetadata(output),
2504
- };
1942
+ });
2505
1943
  return [4, collectBody(output.body, context)];
2506
1944
  case 1:
2507
1945
  _a.sent();
2508
- return [2, Promise.resolve(contents)];
1946
+ return [2, contents];
2509
1947
  }
2510
1948
  });
2511
1949
  }); };
2512
1950
  var deserializeAws_restJson1DeleteApiCacheCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2513
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1951
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2514
1952
  var _c;
2515
1953
  return __generator(this, function (_d) {
2516
1954
  switch (_d.label) {
@@ -2547,14 +1985,14 @@ var deserializeAws_restJson1DeleteApiCacheCommandError = function (output, conte
2547
1985
  case 11: throw _d.sent();
2548
1986
  case 12:
2549
1987
  parsedBody = parsedOutput.body;
2550
- $metadata = deserializeMetadata(output);
2551
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2552
- response = new __BaseException({
2553
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2554
- $fault: "client",
2555
- $metadata: $metadata,
1988
+ throwDefaultError({
1989
+ output: output,
1990
+ parsedBody: parsedBody,
1991
+ exceptionCtor: __BaseException,
1992
+ errorCode: errorCode,
2556
1993
  });
2557
- throw __decorateServiceException(response, parsedBody);
1994
+ _d.label = 13;
1995
+ case 13: return [2];
2558
1996
  }
2559
1997
  });
2560
1998
  }); };
@@ -2566,18 +2004,18 @@ export var deserializeAws_restJson1DeleteApiKeyCommand = function (output, conte
2566
2004
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2567
2005
  return [2, deserializeAws_restJson1DeleteApiKeyCommandError(output, context)];
2568
2006
  }
2569
- contents = {
2007
+ contents = map({
2570
2008
  $metadata: deserializeMetadata(output),
2571
- };
2009
+ });
2572
2010
  return [4, collectBody(output.body, context)];
2573
2011
  case 1:
2574
2012
  _a.sent();
2575
- return [2, Promise.resolve(contents)];
2013
+ return [2, contents];
2576
2014
  }
2577
2015
  });
2578
2016
  }); };
2579
2017
  var deserializeAws_restJson1DeleteApiKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2580
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2018
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2581
2019
  var _c;
2582
2020
  return __generator(this, function (_d) {
2583
2021
  switch (_d.label) {
@@ -2610,14 +2048,14 @@ var deserializeAws_restJson1DeleteApiKeyCommandError = function (output, context
2610
2048
  case 9: throw _d.sent();
2611
2049
  case 10:
2612
2050
  parsedBody = parsedOutput.body;
2613
- $metadata = deserializeMetadata(output);
2614
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2615
- response = new __BaseException({
2616
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2617
- $fault: "client",
2618
- $metadata: $metadata,
2051
+ throwDefaultError({
2052
+ output: output,
2053
+ parsedBody: parsedBody,
2054
+ exceptionCtor: __BaseException,
2055
+ errorCode: errorCode,
2619
2056
  });
2620
- throw __decorateServiceException(response, parsedBody);
2057
+ _d.label = 11;
2058
+ case 11: return [2];
2621
2059
  }
2622
2060
  });
2623
2061
  }); };
@@ -2629,18 +2067,18 @@ export var deserializeAws_restJson1DeleteDataSourceCommand = function (output, c
2629
2067
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2630
2068
  return [2, deserializeAws_restJson1DeleteDataSourceCommandError(output, context)];
2631
2069
  }
2632
- contents = {
2070
+ contents = map({
2633
2071
  $metadata: deserializeMetadata(output),
2634
- };
2072
+ });
2635
2073
  return [4, collectBody(output.body, context)];
2636
2074
  case 1:
2637
2075
  _a.sent();
2638
- return [2, Promise.resolve(contents)];
2076
+ return [2, contents];
2639
2077
  }
2640
2078
  });
2641
2079
  }); };
2642
2080
  var deserializeAws_restJson1DeleteDataSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2643
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2081
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2644
2082
  var _c;
2645
2083
  return __generator(this, function (_d) {
2646
2084
  switch (_d.label) {
@@ -2677,14 +2115,14 @@ var deserializeAws_restJson1DeleteDataSourceCommandError = function (output, con
2677
2115
  case 11: throw _d.sent();
2678
2116
  case 12:
2679
2117
  parsedBody = parsedOutput.body;
2680
- $metadata = deserializeMetadata(output);
2681
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2682
- response = new __BaseException({
2683
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2684
- $fault: "client",
2685
- $metadata: $metadata,
2118
+ throwDefaultError({
2119
+ output: output,
2120
+ parsedBody: parsedBody,
2121
+ exceptionCtor: __BaseException,
2122
+ errorCode: errorCode,
2686
2123
  });
2687
- throw __decorateServiceException(response, parsedBody);
2124
+ _d.label = 13;
2125
+ case 13: return [2];
2688
2126
  }
2689
2127
  });
2690
2128
  }); };
@@ -2696,18 +2134,18 @@ export var deserializeAws_restJson1DeleteDomainNameCommand = function (output, c
2696
2134
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2697
2135
  return [2, deserializeAws_restJson1DeleteDomainNameCommandError(output, context)];
2698
2136
  }
2699
- contents = {
2137
+ contents = map({
2700
2138
  $metadata: deserializeMetadata(output),
2701
- };
2139
+ });
2702
2140
  return [4, collectBody(output.body, context)];
2703
2141
  case 1:
2704
2142
  _a.sent();
2705
- return [2, Promise.resolve(contents)];
2143
+ return [2, contents];
2706
2144
  }
2707
2145
  });
2708
2146
  }); };
2709
2147
  var deserializeAws_restJson1DeleteDomainNameCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2710
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2148
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2711
2149
  var _c;
2712
2150
  return __generator(this, function (_d) {
2713
2151
  switch (_d.label) {
@@ -2744,14 +2182,14 @@ var deserializeAws_restJson1DeleteDomainNameCommandError = function (output, con
2744
2182
  case 11: throw _d.sent();
2745
2183
  case 12:
2746
2184
  parsedBody = parsedOutput.body;
2747
- $metadata = deserializeMetadata(output);
2748
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2749
- response = new __BaseException({
2750
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2751
- $fault: "client",
2752
- $metadata: $metadata,
2185
+ throwDefaultError({
2186
+ output: output,
2187
+ parsedBody: parsedBody,
2188
+ exceptionCtor: __BaseException,
2189
+ errorCode: errorCode,
2753
2190
  });
2754
- throw __decorateServiceException(response, parsedBody);
2191
+ _d.label = 13;
2192
+ case 13: return [2];
2755
2193
  }
2756
2194
  });
2757
2195
  }); };
@@ -2763,18 +2201,18 @@ export var deserializeAws_restJson1DeleteFunctionCommand = function (output, con
2763
2201
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2764
2202
  return [2, deserializeAws_restJson1DeleteFunctionCommandError(output, context)];
2765
2203
  }
2766
- contents = {
2204
+ contents = map({
2767
2205
  $metadata: deserializeMetadata(output),
2768
- };
2206
+ });
2769
2207
  return [4, collectBody(output.body, context)];
2770
2208
  case 1:
2771
2209
  _a.sent();
2772
- return [2, Promise.resolve(contents)];
2210
+ return [2, contents];
2773
2211
  }
2774
2212
  });
2775
2213
  }); };
2776
2214
  var deserializeAws_restJson1DeleteFunctionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2777
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2215
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2778
2216
  var _c;
2779
2217
  return __generator(this, function (_d) {
2780
2218
  switch (_d.label) {
@@ -2807,14 +2245,14 @@ var deserializeAws_restJson1DeleteFunctionCommandError = function (output, conte
2807
2245
  case 9: throw _d.sent();
2808
2246
  case 10:
2809
2247
  parsedBody = parsedOutput.body;
2810
- $metadata = deserializeMetadata(output);
2811
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2812
- response = new __BaseException({
2813
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2814
- $fault: "client",
2815
- $metadata: $metadata,
2248
+ throwDefaultError({
2249
+ output: output,
2250
+ parsedBody: parsedBody,
2251
+ exceptionCtor: __BaseException,
2252
+ errorCode: errorCode,
2816
2253
  });
2817
- throw __decorateServiceException(response, parsedBody);
2254
+ _d.label = 11;
2255
+ case 11: return [2];
2818
2256
  }
2819
2257
  });
2820
2258
  }); };
@@ -2826,18 +2264,18 @@ export var deserializeAws_restJson1DeleteGraphqlApiCommand = function (output, c
2826
2264
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2827
2265
  return [2, deserializeAws_restJson1DeleteGraphqlApiCommandError(output, context)];
2828
2266
  }
2829
- contents = {
2267
+ contents = map({
2830
2268
  $metadata: deserializeMetadata(output),
2831
- };
2269
+ });
2832
2270
  return [4, collectBody(output.body, context)];
2833
2271
  case 1:
2834
2272
  _a.sent();
2835
- return [2, Promise.resolve(contents)];
2273
+ return [2, contents];
2836
2274
  }
2837
2275
  });
2838
2276
  }); };
2839
2277
  var deserializeAws_restJson1DeleteGraphqlApiCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2840
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2278
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2841
2279
  var _c;
2842
2280
  return __generator(this, function (_d) {
2843
2281
  switch (_d.label) {
@@ -2878,14 +2316,14 @@ var deserializeAws_restJson1DeleteGraphqlApiCommandError = function (output, con
2878
2316
  case 13: throw _d.sent();
2879
2317
  case 14:
2880
2318
  parsedBody = parsedOutput.body;
2881
- $metadata = deserializeMetadata(output);
2882
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2883
- response = new __BaseException({
2884
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2885
- $fault: "client",
2886
- $metadata: $metadata,
2319
+ throwDefaultError({
2320
+ output: output,
2321
+ parsedBody: parsedBody,
2322
+ exceptionCtor: __BaseException,
2323
+ errorCode: errorCode,
2887
2324
  });
2888
- throw __decorateServiceException(response, parsedBody);
2325
+ _d.label = 15;
2326
+ case 15: return [2];
2889
2327
  }
2890
2328
  });
2891
2329
  }); };
@@ -2897,18 +2335,18 @@ export var deserializeAws_restJson1DeleteResolverCommand = function (output, con
2897
2335
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2898
2336
  return [2, deserializeAws_restJson1DeleteResolverCommandError(output, context)];
2899
2337
  }
2900
- contents = {
2338
+ contents = map({
2901
2339
  $metadata: deserializeMetadata(output),
2902
- };
2340
+ });
2903
2341
  return [4, collectBody(output.body, context)];
2904
2342
  case 1:
2905
2343
  _a.sent();
2906
- return [2, Promise.resolve(contents)];
2344
+ return [2, contents];
2907
2345
  }
2908
2346
  });
2909
2347
  }); };
2910
2348
  var deserializeAws_restJson1DeleteResolverCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2911
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2349
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2912
2350
  var _c;
2913
2351
  return __generator(this, function (_d) {
2914
2352
  switch (_d.label) {
@@ -2941,14 +2379,14 @@ var deserializeAws_restJson1DeleteResolverCommandError = function (output, conte
2941
2379
  case 9: throw _d.sent();
2942
2380
  case 10:
2943
2381
  parsedBody = parsedOutput.body;
2944
- $metadata = deserializeMetadata(output);
2945
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2946
- response = new __BaseException({
2947
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2948
- $fault: "client",
2949
- $metadata: $metadata,
2382
+ throwDefaultError({
2383
+ output: output,
2384
+ parsedBody: parsedBody,
2385
+ exceptionCtor: __BaseException,
2386
+ errorCode: errorCode,
2950
2387
  });
2951
- throw __decorateServiceException(response, parsedBody);
2388
+ _d.label = 11;
2389
+ case 11: return [2];
2952
2390
  }
2953
2391
  });
2954
2392
  }); };
@@ -2960,18 +2398,18 @@ export var deserializeAws_restJson1DeleteTypeCommand = function (output, context
2960
2398
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2961
2399
  return [2, deserializeAws_restJson1DeleteTypeCommandError(output, context)];
2962
2400
  }
2963
- contents = {
2401
+ contents = map({
2964
2402
  $metadata: deserializeMetadata(output),
2965
- };
2403
+ });
2966
2404
  return [4, collectBody(output.body, context)];
2967
2405
  case 1:
2968
2406
  _a.sent();
2969
- return [2, Promise.resolve(contents)];
2407
+ return [2, contents];
2970
2408
  }
2971
2409
  });
2972
2410
  }); };
2973
2411
  var deserializeAws_restJson1DeleteTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2974
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2412
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2975
2413
  var _c;
2976
2414
  return __generator(this, function (_d) {
2977
2415
  switch (_d.label) {
@@ -3008,14 +2446,14 @@ var deserializeAws_restJson1DeleteTypeCommandError = function (output, context)
3008
2446
  case 11: throw _d.sent();
3009
2447
  case 12:
3010
2448
  parsedBody = parsedOutput.body;
3011
- $metadata = deserializeMetadata(output);
3012
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3013
- response = new __BaseException({
3014
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3015
- $fault: "client",
3016
- $metadata: $metadata,
2449
+ throwDefaultError({
2450
+ output: output,
2451
+ parsedBody: parsedBody,
2452
+ exceptionCtor: __BaseException,
2453
+ errorCode: errorCode,
3017
2454
  });
3018
- throw __decorateServiceException(response, parsedBody);
2455
+ _d.label = 13;
2456
+ case 13: return [2];
3019
2457
  }
3020
2458
  });
3021
2459
  }); };
@@ -3027,18 +2465,18 @@ export var deserializeAws_restJson1DisassociateApiCommand = function (output, co
3027
2465
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3028
2466
  return [2, deserializeAws_restJson1DisassociateApiCommandError(output, context)];
3029
2467
  }
3030
- contents = {
2468
+ contents = map({
3031
2469
  $metadata: deserializeMetadata(output),
3032
- };
2470
+ });
3033
2471
  return [4, collectBody(output.body, context)];
3034
2472
  case 1:
3035
2473
  _a.sent();
3036
- return [2, Promise.resolve(contents)];
2474
+ return [2, contents];
3037
2475
  }
3038
2476
  });
3039
2477
  }); };
3040
2478
  var deserializeAws_restJson1DisassociateApiCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3041
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2479
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3042
2480
  var _c;
3043
2481
  return __generator(this, function (_d) {
3044
2482
  switch (_d.label) {
@@ -3075,14 +2513,14 @@ var deserializeAws_restJson1DisassociateApiCommandError = function (output, cont
3075
2513
  case 11: throw _d.sent();
3076
2514
  case 12:
3077
2515
  parsedBody = parsedOutput.body;
3078
- $metadata = deserializeMetadata(output);
3079
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3080
- response = new __BaseException({
3081
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3082
- $fault: "client",
3083
- $metadata: $metadata,
2516
+ throwDefaultError({
2517
+ output: output,
2518
+ parsedBody: parsedBody,
2519
+ exceptionCtor: __BaseException,
2520
+ errorCode: errorCode,
3084
2521
  });
3085
- throw __decorateServiceException(response, parsedBody);
2522
+ _d.label = 13;
2523
+ case 13: return [2];
3086
2524
  }
3087
2525
  });
3088
2526
  }); };
@@ -3094,28 +2532,26 @@ export var deserializeAws_restJson1EvaluateMappingTemplateCommand = function (ou
3094
2532
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3095
2533
  return [2, deserializeAws_restJson1EvaluateMappingTemplateCommandError(output, context)];
3096
2534
  }
3097
- contents = {
2535
+ contents = map({
3098
2536
  $metadata: deserializeMetadata(output),
3099
- error: undefined,
3100
- evaluationResult: undefined,
3101
- };
2537
+ });
3102
2538
  _a = __expectNonNull;
3103
2539
  _b = __expectObject;
3104
2540
  return [4, parseBody(output.body, context)];
3105
2541
  case 1:
3106
2542
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3107
- if (data.error !== undefined && data.error !== null) {
2543
+ if (data.error != null) {
3108
2544
  contents.error = deserializeAws_restJson1ErrorDetail(data.error, context);
3109
2545
  }
3110
- if (data.evaluationResult !== undefined && data.evaluationResult !== null) {
2546
+ if (data.evaluationResult != null) {
3111
2547
  contents.evaluationResult = __expectString(data.evaluationResult);
3112
2548
  }
3113
- return [2, Promise.resolve(contents)];
2549
+ return [2, contents];
3114
2550
  }
3115
2551
  });
3116
2552
  }); };
3117
2553
  var deserializeAws_restJson1EvaluateMappingTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3118
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2554
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3119
2555
  var _c;
3120
2556
  return __generator(this, function (_d) {
3121
2557
  switch (_d.label) {
@@ -3144,14 +2580,14 @@ var deserializeAws_restJson1EvaluateMappingTemplateCommandError = function (outp
3144
2580
  case 7: throw _d.sent();
3145
2581
  case 8:
3146
2582
  parsedBody = parsedOutput.body;
3147
- $metadata = deserializeMetadata(output);
3148
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3149
- response = new __BaseException({
3150
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3151
- $fault: "client",
3152
- $metadata: $metadata,
2583
+ throwDefaultError({
2584
+ output: output,
2585
+ parsedBody: parsedBody,
2586
+ exceptionCtor: __BaseException,
2587
+ errorCode: errorCode,
3153
2588
  });
3154
- throw __decorateServiceException(response, parsedBody);
2589
+ _d.label = 9;
2590
+ case 9: return [2];
3155
2591
  }
3156
2592
  });
3157
2593
  }); };
@@ -3163,18 +2599,18 @@ export var deserializeAws_restJson1FlushApiCacheCommand = function (output, cont
3163
2599
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3164
2600
  return [2, deserializeAws_restJson1FlushApiCacheCommandError(output, context)];
3165
2601
  }
3166
- contents = {
2602
+ contents = map({
3167
2603
  $metadata: deserializeMetadata(output),
3168
- };
2604
+ });
3169
2605
  return [4, collectBody(output.body, context)];
3170
2606
  case 1:
3171
2607
  _a.sent();
3172
- return [2, Promise.resolve(contents)];
2608
+ return [2, contents];
3173
2609
  }
3174
2610
  });
3175
2611
  }); };
3176
2612
  var deserializeAws_restJson1FlushApiCacheCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3177
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2613
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3178
2614
  var _c;
3179
2615
  return __generator(this, function (_d) {
3180
2616
  switch (_d.label) {
@@ -3211,14 +2647,14 @@ var deserializeAws_restJson1FlushApiCacheCommandError = function (output, contex
3211
2647
  case 11: throw _d.sent();
3212
2648
  case 12:
3213
2649
  parsedBody = parsedOutput.body;
3214
- $metadata = deserializeMetadata(output);
3215
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3216
- response = new __BaseException({
3217
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3218
- $fault: "client",
3219
- $metadata: $metadata,
2650
+ throwDefaultError({
2651
+ output: output,
2652
+ parsedBody: parsedBody,
2653
+ exceptionCtor: __BaseException,
2654
+ errorCode: errorCode,
3220
2655
  });
3221
- throw __decorateServiceException(response, parsedBody);
2656
+ _d.label = 13;
2657
+ case 13: return [2];
3222
2658
  }
3223
2659
  });
3224
2660
  }); };
@@ -3230,24 +2666,23 @@ export var deserializeAws_restJson1GetApiAssociationCommand = function (output,
3230
2666
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3231
2667
  return [2, deserializeAws_restJson1GetApiAssociationCommandError(output, context)];
3232
2668
  }
3233
- contents = {
2669
+ contents = map({
3234
2670
  $metadata: deserializeMetadata(output),
3235
- apiAssociation: undefined,
3236
- };
2671
+ });
3237
2672
  _a = __expectNonNull;
3238
2673
  _b = __expectObject;
3239
2674
  return [4, parseBody(output.body, context)];
3240
2675
  case 1:
3241
2676
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3242
- if (data.apiAssociation !== undefined && data.apiAssociation !== null) {
2677
+ if (data.apiAssociation != null) {
3243
2678
  contents.apiAssociation = deserializeAws_restJson1ApiAssociation(data.apiAssociation, context);
3244
2679
  }
3245
- return [2, Promise.resolve(contents)];
2680
+ return [2, contents];
3246
2681
  }
3247
2682
  });
3248
2683
  }); };
3249
2684
  var deserializeAws_restJson1GetApiAssociationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3250
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2685
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3251
2686
  var _c;
3252
2687
  return __generator(this, function (_d) {
3253
2688
  switch (_d.label) {
@@ -3280,14 +2715,14 @@ var deserializeAws_restJson1GetApiAssociationCommandError = function (output, co
3280
2715
  case 9: throw _d.sent();
3281
2716
  case 10:
3282
2717
  parsedBody = parsedOutput.body;
3283
- $metadata = deserializeMetadata(output);
3284
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3285
- response = new __BaseException({
3286
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3287
- $fault: "client",
3288
- $metadata: $metadata,
2718
+ throwDefaultError({
2719
+ output: output,
2720
+ parsedBody: parsedBody,
2721
+ exceptionCtor: __BaseException,
2722
+ errorCode: errorCode,
3289
2723
  });
3290
- throw __decorateServiceException(response, parsedBody);
2724
+ _d.label = 11;
2725
+ case 11: return [2];
3291
2726
  }
3292
2727
  });
3293
2728
  }); };
@@ -3299,24 +2734,23 @@ export var deserializeAws_restJson1GetApiCacheCommand = function (output, contex
3299
2734
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3300
2735
  return [2, deserializeAws_restJson1GetApiCacheCommandError(output, context)];
3301
2736
  }
3302
- contents = {
2737
+ contents = map({
3303
2738
  $metadata: deserializeMetadata(output),
3304
- apiCache: undefined,
3305
- };
2739
+ });
3306
2740
  _a = __expectNonNull;
3307
2741
  _b = __expectObject;
3308
2742
  return [4, parseBody(output.body, context)];
3309
2743
  case 1:
3310
2744
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3311
- if (data.apiCache !== undefined && data.apiCache !== null) {
2745
+ if (data.apiCache != null) {
3312
2746
  contents.apiCache = deserializeAws_restJson1ApiCache(data.apiCache, context);
3313
2747
  }
3314
- return [2, Promise.resolve(contents)];
2748
+ return [2, contents];
3315
2749
  }
3316
2750
  });
3317
2751
  }); };
3318
2752
  var deserializeAws_restJson1GetApiCacheCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3319
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2753
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3320
2754
  var _c;
3321
2755
  return __generator(this, function (_d) {
3322
2756
  switch (_d.label) {
@@ -3353,14 +2787,14 @@ var deserializeAws_restJson1GetApiCacheCommandError = function (output, context)
3353
2787
  case 11: throw _d.sent();
3354
2788
  case 12:
3355
2789
  parsedBody = parsedOutput.body;
3356
- $metadata = deserializeMetadata(output);
3357
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3358
- response = new __BaseException({
3359
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3360
- $fault: "client",
3361
- $metadata: $metadata,
2790
+ throwDefaultError({
2791
+ output: output,
2792
+ parsedBody: parsedBody,
2793
+ exceptionCtor: __BaseException,
2794
+ errorCode: errorCode,
3362
2795
  });
3363
- throw __decorateServiceException(response, parsedBody);
2796
+ _d.label = 13;
2797
+ case 13: return [2];
3364
2798
  }
3365
2799
  });
3366
2800
  }); };
@@ -3372,24 +2806,23 @@ export var deserializeAws_restJson1GetDataSourceCommand = function (output, cont
3372
2806
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3373
2807
  return [2, deserializeAws_restJson1GetDataSourceCommandError(output, context)];
3374
2808
  }
3375
- contents = {
2809
+ contents = map({
3376
2810
  $metadata: deserializeMetadata(output),
3377
- dataSource: undefined,
3378
- };
2811
+ });
3379
2812
  _a = __expectNonNull;
3380
2813
  _b = __expectObject;
3381
2814
  return [4, parseBody(output.body, context)];
3382
2815
  case 1:
3383
2816
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3384
- if (data.dataSource !== undefined && data.dataSource !== null) {
2817
+ if (data.dataSource != null) {
3385
2818
  contents.dataSource = deserializeAws_restJson1DataSource(data.dataSource, context);
3386
2819
  }
3387
- return [2, Promise.resolve(contents)];
2820
+ return [2, contents];
3388
2821
  }
3389
2822
  });
3390
2823
  }); };
3391
2824
  var deserializeAws_restJson1GetDataSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3392
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2825
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3393
2826
  var _c;
3394
2827
  return __generator(this, function (_d) {
3395
2828
  switch (_d.label) {
@@ -3426,14 +2859,14 @@ var deserializeAws_restJson1GetDataSourceCommandError = function (output, contex
3426
2859
  case 11: throw _d.sent();
3427
2860
  case 12:
3428
2861
  parsedBody = parsedOutput.body;
3429
- $metadata = deserializeMetadata(output);
3430
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3431
- response = new __BaseException({
3432
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3433
- $fault: "client",
3434
- $metadata: $metadata,
2862
+ throwDefaultError({
2863
+ output: output,
2864
+ parsedBody: parsedBody,
2865
+ exceptionCtor: __BaseException,
2866
+ errorCode: errorCode,
3435
2867
  });
3436
- throw __decorateServiceException(response, parsedBody);
2868
+ _d.label = 13;
2869
+ case 13: return [2];
3437
2870
  }
3438
2871
  });
3439
2872
  }); };
@@ -3445,24 +2878,23 @@ export var deserializeAws_restJson1GetDomainNameCommand = function (output, cont
3445
2878
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3446
2879
  return [2, deserializeAws_restJson1GetDomainNameCommandError(output, context)];
3447
2880
  }
3448
- contents = {
2881
+ contents = map({
3449
2882
  $metadata: deserializeMetadata(output),
3450
- domainNameConfig: undefined,
3451
- };
2883
+ });
3452
2884
  _a = __expectNonNull;
3453
2885
  _b = __expectObject;
3454
2886
  return [4, parseBody(output.body, context)];
3455
2887
  case 1:
3456
2888
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3457
- if (data.domainNameConfig !== undefined && data.domainNameConfig !== null) {
2889
+ if (data.domainNameConfig != null) {
3458
2890
  contents.domainNameConfig = deserializeAws_restJson1DomainNameConfig(data.domainNameConfig, context);
3459
2891
  }
3460
- return [2, Promise.resolve(contents)];
2892
+ return [2, contents];
3461
2893
  }
3462
2894
  });
3463
2895
  }); };
3464
2896
  var deserializeAws_restJson1GetDomainNameCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3465
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2897
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3466
2898
  var _c;
3467
2899
  return __generator(this, function (_d) {
3468
2900
  switch (_d.label) {
@@ -3495,14 +2927,14 @@ var deserializeAws_restJson1GetDomainNameCommandError = function (output, contex
3495
2927
  case 9: throw _d.sent();
3496
2928
  case 10:
3497
2929
  parsedBody = parsedOutput.body;
3498
- $metadata = deserializeMetadata(output);
3499
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3500
- response = new __BaseException({
3501
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3502
- $fault: "client",
3503
- $metadata: $metadata,
2930
+ throwDefaultError({
2931
+ output: output,
2932
+ parsedBody: parsedBody,
2933
+ exceptionCtor: __BaseException,
2934
+ errorCode: errorCode,
3504
2935
  });
3505
- throw __decorateServiceException(response, parsedBody);
2936
+ _d.label = 11;
2937
+ case 11: return [2];
3506
2938
  }
3507
2939
  });
3508
2940
  }); };
@@ -3514,24 +2946,23 @@ export var deserializeAws_restJson1GetFunctionCommand = function (output, contex
3514
2946
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3515
2947
  return [2, deserializeAws_restJson1GetFunctionCommandError(output, context)];
3516
2948
  }
3517
- contents = {
2949
+ contents = map({
3518
2950
  $metadata: deserializeMetadata(output),
3519
- functionConfiguration: undefined,
3520
- };
2951
+ });
3521
2952
  _a = __expectNonNull;
3522
2953
  _b = __expectObject;
3523
2954
  return [4, parseBody(output.body, context)];
3524
2955
  case 1:
3525
2956
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3526
- if (data.functionConfiguration !== undefined && data.functionConfiguration !== null) {
2957
+ if (data.functionConfiguration != null) {
3527
2958
  contents.functionConfiguration = deserializeAws_restJson1FunctionConfiguration(data.functionConfiguration, context);
3528
2959
  }
3529
- return [2, Promise.resolve(contents)];
2960
+ return [2, contents];
3530
2961
  }
3531
2962
  });
3532
2963
  }); };
3533
2964
  var deserializeAws_restJson1GetFunctionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3534
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2965
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3535
2966
  var _c;
3536
2967
  return __generator(this, function (_d) {
3537
2968
  switch (_d.label) {
@@ -3560,14 +2991,14 @@ var deserializeAws_restJson1GetFunctionCommandError = function (output, context)
3560
2991
  case 7: throw _d.sent();
3561
2992
  case 8:
3562
2993
  parsedBody = parsedOutput.body;
3563
- $metadata = deserializeMetadata(output);
3564
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3565
- response = new __BaseException({
3566
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3567
- $fault: "client",
3568
- $metadata: $metadata,
2994
+ throwDefaultError({
2995
+ output: output,
2996
+ parsedBody: parsedBody,
2997
+ exceptionCtor: __BaseException,
2998
+ errorCode: errorCode,
3569
2999
  });
3570
- throw __decorateServiceException(response, parsedBody);
3000
+ _d.label = 9;
3001
+ case 9: return [2];
3571
3002
  }
3572
3003
  });
3573
3004
  }); };
@@ -3579,24 +3010,23 @@ export var deserializeAws_restJson1GetGraphqlApiCommand = function (output, cont
3579
3010
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3580
3011
  return [2, deserializeAws_restJson1GetGraphqlApiCommandError(output, context)];
3581
3012
  }
3582
- contents = {
3013
+ contents = map({
3583
3014
  $metadata: deserializeMetadata(output),
3584
- graphqlApi: undefined,
3585
- };
3015
+ });
3586
3016
  _a = __expectNonNull;
3587
3017
  _b = __expectObject;
3588
3018
  return [4, parseBody(output.body, context)];
3589
3019
  case 1:
3590
3020
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3591
- if (data.graphqlApi !== undefined && data.graphqlApi !== null) {
3021
+ if (data.graphqlApi != null) {
3592
3022
  contents.graphqlApi = deserializeAws_restJson1GraphqlApi(data.graphqlApi, context);
3593
3023
  }
3594
- return [2, Promise.resolve(contents)];
3024
+ return [2, contents];
3595
3025
  }
3596
3026
  });
3597
3027
  }); };
3598
3028
  var deserializeAws_restJson1GetGraphqlApiCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3599
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3029
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3600
3030
  var _c;
3601
3031
  return __generator(this, function (_d) {
3602
3032
  switch (_d.label) {
@@ -3633,14 +3063,14 @@ var deserializeAws_restJson1GetGraphqlApiCommandError = function (output, contex
3633
3063
  case 11: throw _d.sent();
3634
3064
  case 12:
3635
3065
  parsedBody = parsedOutput.body;
3636
- $metadata = deserializeMetadata(output);
3637
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3638
- response = new __BaseException({
3639
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3640
- $fault: "client",
3641
- $metadata: $metadata,
3066
+ throwDefaultError({
3067
+ output: output,
3068
+ parsedBody: parsedBody,
3069
+ exceptionCtor: __BaseException,
3070
+ errorCode: errorCode,
3642
3071
  });
3643
- throw __decorateServiceException(response, parsedBody);
3072
+ _d.label = 13;
3073
+ case 13: return [2];
3644
3074
  }
3645
3075
  });
3646
3076
  }); };
@@ -3652,20 +3082,19 @@ export var deserializeAws_restJson1GetIntrospectionSchemaCommand = function (out
3652
3082
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3653
3083
  return [2, deserializeAws_restJson1GetIntrospectionSchemaCommandError(output, context)];
3654
3084
  }
3655
- contents = {
3085
+ contents = map({
3656
3086
  $metadata: deserializeMetadata(output),
3657
- schema: undefined,
3658
- };
3087
+ });
3659
3088
  return [4, collectBody(output.body, context)];
3660
3089
  case 1:
3661
3090
  data = _a.sent();
3662
3091
  contents.schema = data;
3663
- return [2, Promise.resolve(contents)];
3092
+ return [2, contents];
3664
3093
  }
3665
3094
  });
3666
3095
  }); };
3667
3096
  var deserializeAws_restJson1GetIntrospectionSchemaCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3668
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3097
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3669
3098
  var _c;
3670
3099
  return __generator(this, function (_d) {
3671
3100
  switch (_d.label) {
@@ -3698,14 +3127,14 @@ var deserializeAws_restJson1GetIntrospectionSchemaCommandError = function (outpu
3698
3127
  case 9: throw _d.sent();
3699
3128
  case 10:
3700
3129
  parsedBody = parsedOutput.body;
3701
- $metadata = deserializeMetadata(output);
3702
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3703
- response = new __BaseException({
3704
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3705
- $fault: "client",
3706
- $metadata: $metadata,
3130
+ throwDefaultError({
3131
+ output: output,
3132
+ parsedBody: parsedBody,
3133
+ exceptionCtor: __BaseException,
3134
+ errorCode: errorCode,
3707
3135
  });
3708
- throw __decorateServiceException(response, parsedBody);
3136
+ _d.label = 11;
3137
+ case 11: return [2];
3709
3138
  }
3710
3139
  });
3711
3140
  }); };
@@ -3717,24 +3146,23 @@ export var deserializeAws_restJson1GetResolverCommand = function (output, contex
3717
3146
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3718
3147
  return [2, deserializeAws_restJson1GetResolverCommandError(output, context)];
3719
3148
  }
3720
- contents = {
3149
+ contents = map({
3721
3150
  $metadata: deserializeMetadata(output),
3722
- resolver: undefined,
3723
- };
3151
+ });
3724
3152
  _a = __expectNonNull;
3725
3153
  _b = __expectObject;
3726
3154
  return [4, parseBody(output.body, context)];
3727
3155
  case 1:
3728
3156
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3729
- if (data.resolver !== undefined && data.resolver !== null) {
3157
+ if (data.resolver != null) {
3730
3158
  contents.resolver = deserializeAws_restJson1Resolver(data.resolver, context);
3731
3159
  }
3732
- return [2, Promise.resolve(contents)];
3160
+ return [2, contents];
3733
3161
  }
3734
3162
  });
3735
3163
  }); };
3736
3164
  var deserializeAws_restJson1GetResolverCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3737
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3165
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3738
3166
  var _c;
3739
3167
  return __generator(this, function (_d) {
3740
3168
  switch (_d.label) {
@@ -3763,14 +3191,14 @@ var deserializeAws_restJson1GetResolverCommandError = function (output, context)
3763
3191
  case 7: throw _d.sent();
3764
3192
  case 8:
3765
3193
  parsedBody = parsedOutput.body;
3766
- $metadata = deserializeMetadata(output);
3767
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3768
- response = new __BaseException({
3769
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3770
- $fault: "client",
3771
- $metadata: $metadata,
3194
+ throwDefaultError({
3195
+ output: output,
3196
+ parsedBody: parsedBody,
3197
+ exceptionCtor: __BaseException,
3198
+ errorCode: errorCode,
3772
3199
  });
3773
- throw __decorateServiceException(response, parsedBody);
3200
+ _d.label = 9;
3201
+ case 9: return [2];
3774
3202
  }
3775
3203
  });
3776
3204
  }); };
@@ -3782,28 +3210,26 @@ export var deserializeAws_restJson1GetSchemaCreationStatusCommand = function (ou
3782
3210
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3783
3211
  return [2, deserializeAws_restJson1GetSchemaCreationStatusCommandError(output, context)];
3784
3212
  }
3785
- contents = {
3213
+ contents = map({
3786
3214
  $metadata: deserializeMetadata(output),
3787
- details: undefined,
3788
- status: undefined,
3789
- };
3215
+ });
3790
3216
  _a = __expectNonNull;
3791
3217
  _b = __expectObject;
3792
3218
  return [4, parseBody(output.body, context)];
3793
3219
  case 1:
3794
3220
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3795
- if (data.details !== undefined && data.details !== null) {
3221
+ if (data.details != null) {
3796
3222
  contents.details = __expectString(data.details);
3797
3223
  }
3798
- if (data.status !== undefined && data.status !== null) {
3224
+ if (data.status != null) {
3799
3225
  contents.status = __expectString(data.status);
3800
3226
  }
3801
- return [2, Promise.resolve(contents)];
3227
+ return [2, contents];
3802
3228
  }
3803
3229
  });
3804
3230
  }); };
3805
3231
  var deserializeAws_restJson1GetSchemaCreationStatusCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3806
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3232
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3807
3233
  var _c;
3808
3234
  return __generator(this, function (_d) {
3809
3235
  switch (_d.label) {
@@ -3836,14 +3262,14 @@ var deserializeAws_restJson1GetSchemaCreationStatusCommandError = function (outp
3836
3262
  case 9: throw _d.sent();
3837
3263
  case 10:
3838
3264
  parsedBody = parsedOutput.body;
3839
- $metadata = deserializeMetadata(output);
3840
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3841
- response = new __BaseException({
3842
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3843
- $fault: "client",
3844
- $metadata: $metadata,
3265
+ throwDefaultError({
3266
+ output: output,
3267
+ parsedBody: parsedBody,
3268
+ exceptionCtor: __BaseException,
3269
+ errorCode: errorCode,
3845
3270
  });
3846
- throw __decorateServiceException(response, parsedBody);
3271
+ _d.label = 11;
3272
+ case 11: return [2];
3847
3273
  }
3848
3274
  });
3849
3275
  }); };
@@ -3855,24 +3281,23 @@ export var deserializeAws_restJson1GetTypeCommand = function (output, context) {
3855
3281
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3856
3282
  return [2, deserializeAws_restJson1GetTypeCommandError(output, context)];
3857
3283
  }
3858
- contents = {
3284
+ contents = map({
3859
3285
  $metadata: deserializeMetadata(output),
3860
- type: undefined,
3861
- };
3286
+ });
3862
3287
  _a = __expectNonNull;
3863
3288
  _b = __expectObject;
3864
3289
  return [4, parseBody(output.body, context)];
3865
3290
  case 1:
3866
3291
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3867
- if (data.type !== undefined && data.type !== null) {
3292
+ if (data.type != null) {
3868
3293
  contents.type = deserializeAws_restJson1Type(data.type, context);
3869
3294
  }
3870
- return [2, Promise.resolve(contents)];
3295
+ return [2, contents];
3871
3296
  }
3872
3297
  });
3873
3298
  }); };
3874
3299
  var deserializeAws_restJson1GetTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3875
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3300
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3876
3301
  var _c;
3877
3302
  return __generator(this, function (_d) {
3878
3303
  switch (_d.label) {
@@ -3909,14 +3334,14 @@ var deserializeAws_restJson1GetTypeCommandError = function (output, context) { r
3909
3334
  case 11: throw _d.sent();
3910
3335
  case 12:
3911
3336
  parsedBody = parsedOutput.body;
3912
- $metadata = deserializeMetadata(output);
3913
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3914
- response = new __BaseException({
3915
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3916
- $fault: "client",
3917
- $metadata: $metadata,
3337
+ throwDefaultError({
3338
+ output: output,
3339
+ parsedBody: parsedBody,
3340
+ exceptionCtor: __BaseException,
3341
+ errorCode: errorCode,
3918
3342
  });
3919
- throw __decorateServiceException(response, parsedBody);
3343
+ _d.label = 13;
3344
+ case 13: return [2];
3920
3345
  }
3921
3346
  });
3922
3347
  }); };
@@ -3928,28 +3353,26 @@ export var deserializeAws_restJson1ListApiKeysCommand = function (output, contex
3928
3353
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3929
3354
  return [2, deserializeAws_restJson1ListApiKeysCommandError(output, context)];
3930
3355
  }
3931
- contents = {
3356
+ contents = map({
3932
3357
  $metadata: deserializeMetadata(output),
3933
- apiKeys: undefined,
3934
- nextToken: undefined,
3935
- };
3358
+ });
3936
3359
  _a = __expectNonNull;
3937
3360
  _b = __expectObject;
3938
3361
  return [4, parseBody(output.body, context)];
3939
3362
  case 1:
3940
3363
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3941
- if (data.apiKeys !== undefined && data.apiKeys !== null) {
3364
+ if (data.apiKeys != null) {
3942
3365
  contents.apiKeys = deserializeAws_restJson1ApiKeys(data.apiKeys, context);
3943
3366
  }
3944
- if (data.nextToken !== undefined && data.nextToken !== null) {
3367
+ if (data.nextToken != null) {
3945
3368
  contents.nextToken = __expectString(data.nextToken);
3946
3369
  }
3947
- return [2, Promise.resolve(contents)];
3370
+ return [2, contents];
3948
3371
  }
3949
3372
  });
3950
3373
  }); };
3951
3374
  var deserializeAws_restJson1ListApiKeysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3952
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3375
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3953
3376
  var _c;
3954
3377
  return __generator(this, function (_d) {
3955
3378
  switch (_d.label) {
@@ -3982,14 +3405,14 @@ var deserializeAws_restJson1ListApiKeysCommandError = function (output, context)
3982
3405
  case 9: throw _d.sent();
3983
3406
  case 10:
3984
3407
  parsedBody = parsedOutput.body;
3985
- $metadata = deserializeMetadata(output);
3986
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3987
- response = new __BaseException({
3988
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3989
- $fault: "client",
3990
- $metadata: $metadata,
3408
+ throwDefaultError({
3409
+ output: output,
3410
+ parsedBody: parsedBody,
3411
+ exceptionCtor: __BaseException,
3412
+ errorCode: errorCode,
3991
3413
  });
3992
- throw __decorateServiceException(response, parsedBody);
3414
+ _d.label = 11;
3415
+ case 11: return [2];
3993
3416
  }
3994
3417
  });
3995
3418
  }); };
@@ -4001,28 +3424,26 @@ export var deserializeAws_restJson1ListDataSourcesCommand = function (output, co
4001
3424
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4002
3425
  return [2, deserializeAws_restJson1ListDataSourcesCommandError(output, context)];
4003
3426
  }
4004
- contents = {
3427
+ contents = map({
4005
3428
  $metadata: deserializeMetadata(output),
4006
- dataSources: undefined,
4007
- nextToken: undefined,
4008
- };
3429
+ });
4009
3430
  _a = __expectNonNull;
4010
3431
  _b = __expectObject;
4011
3432
  return [4, parseBody(output.body, context)];
4012
3433
  case 1:
4013
3434
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4014
- if (data.dataSources !== undefined && data.dataSources !== null) {
3435
+ if (data.dataSources != null) {
4015
3436
  contents.dataSources = deserializeAws_restJson1DataSources(data.dataSources, context);
4016
3437
  }
4017
- if (data.nextToken !== undefined && data.nextToken !== null) {
3438
+ if (data.nextToken != null) {
4018
3439
  contents.nextToken = __expectString(data.nextToken);
4019
3440
  }
4020
- return [2, Promise.resolve(contents)];
3441
+ return [2, contents];
4021
3442
  }
4022
3443
  });
4023
3444
  }); };
4024
3445
  var deserializeAws_restJson1ListDataSourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4025
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3446
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4026
3447
  var _c;
4027
3448
  return __generator(this, function (_d) {
4028
3449
  switch (_d.label) {
@@ -4055,14 +3476,14 @@ var deserializeAws_restJson1ListDataSourcesCommandError = function (output, cont
4055
3476
  case 9: throw _d.sent();
4056
3477
  case 10:
4057
3478
  parsedBody = parsedOutput.body;
4058
- $metadata = deserializeMetadata(output);
4059
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4060
- response = new __BaseException({
4061
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4062
- $fault: "client",
4063
- $metadata: $metadata,
3479
+ throwDefaultError({
3480
+ output: output,
3481
+ parsedBody: parsedBody,
3482
+ exceptionCtor: __BaseException,
3483
+ errorCode: errorCode,
4064
3484
  });
4065
- throw __decorateServiceException(response, parsedBody);
3485
+ _d.label = 11;
3486
+ case 11: return [2];
4066
3487
  }
4067
3488
  });
4068
3489
  }); };
@@ -4074,28 +3495,26 @@ export var deserializeAws_restJson1ListDomainNamesCommand = function (output, co
4074
3495
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4075
3496
  return [2, deserializeAws_restJson1ListDomainNamesCommandError(output, context)];
4076
3497
  }
4077
- contents = {
3498
+ contents = map({
4078
3499
  $metadata: deserializeMetadata(output),
4079
- domainNameConfigs: undefined,
4080
- nextToken: undefined,
4081
- };
3500
+ });
4082
3501
  _a = __expectNonNull;
4083
3502
  _b = __expectObject;
4084
3503
  return [4, parseBody(output.body, context)];
4085
3504
  case 1:
4086
3505
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4087
- if (data.domainNameConfigs !== undefined && data.domainNameConfigs !== null) {
3506
+ if (data.domainNameConfigs != null) {
4088
3507
  contents.domainNameConfigs = deserializeAws_restJson1DomainNameConfigs(data.domainNameConfigs, context);
4089
3508
  }
4090
- if (data.nextToken !== undefined && data.nextToken !== null) {
3509
+ if (data.nextToken != null) {
4091
3510
  contents.nextToken = __expectString(data.nextToken);
4092
3511
  }
4093
- return [2, Promise.resolve(contents)];
3512
+ return [2, contents];
4094
3513
  }
4095
3514
  });
4096
3515
  }); };
4097
3516
  var deserializeAws_restJson1ListDomainNamesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4098
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3517
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4099
3518
  var _c;
4100
3519
  return __generator(this, function (_d) {
4101
3520
  switch (_d.label) {
@@ -4124,14 +3543,14 @@ var deserializeAws_restJson1ListDomainNamesCommandError = function (output, cont
4124
3543
  case 7: throw _d.sent();
4125
3544
  case 8:
4126
3545
  parsedBody = parsedOutput.body;
4127
- $metadata = deserializeMetadata(output);
4128
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4129
- response = new __BaseException({
4130
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4131
- $fault: "client",
4132
- $metadata: $metadata,
3546
+ throwDefaultError({
3547
+ output: output,
3548
+ parsedBody: parsedBody,
3549
+ exceptionCtor: __BaseException,
3550
+ errorCode: errorCode,
4133
3551
  });
4134
- throw __decorateServiceException(response, parsedBody);
3552
+ _d.label = 9;
3553
+ case 9: return [2];
4135
3554
  }
4136
3555
  });
4137
3556
  }); };
@@ -4143,28 +3562,26 @@ export var deserializeAws_restJson1ListFunctionsCommand = function (output, cont
4143
3562
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4144
3563
  return [2, deserializeAws_restJson1ListFunctionsCommandError(output, context)];
4145
3564
  }
4146
- contents = {
3565
+ contents = map({
4147
3566
  $metadata: deserializeMetadata(output),
4148
- functions: undefined,
4149
- nextToken: undefined,
4150
- };
3567
+ });
4151
3568
  _a = __expectNonNull;
4152
3569
  _b = __expectObject;
4153
3570
  return [4, parseBody(output.body, context)];
4154
3571
  case 1:
4155
3572
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4156
- if (data.functions !== undefined && data.functions !== null) {
3573
+ if (data.functions != null) {
4157
3574
  contents.functions = deserializeAws_restJson1Functions(data.functions, context);
4158
3575
  }
4159
- if (data.nextToken !== undefined && data.nextToken !== null) {
3576
+ if (data.nextToken != null) {
4160
3577
  contents.nextToken = __expectString(data.nextToken);
4161
3578
  }
4162
- return [2, Promise.resolve(contents)];
3579
+ return [2, contents];
4163
3580
  }
4164
3581
  });
4165
3582
  }); };
4166
3583
  var deserializeAws_restJson1ListFunctionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4167
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3584
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4168
3585
  var _c;
4169
3586
  return __generator(this, function (_d) {
4170
3587
  switch (_d.label) {
@@ -4197,14 +3614,14 @@ var deserializeAws_restJson1ListFunctionsCommandError = function (output, contex
4197
3614
  case 9: throw _d.sent();
4198
3615
  case 10:
4199
3616
  parsedBody = parsedOutput.body;
4200
- $metadata = deserializeMetadata(output);
4201
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4202
- response = new __BaseException({
4203
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4204
- $fault: "client",
4205
- $metadata: $metadata,
3617
+ throwDefaultError({
3618
+ output: output,
3619
+ parsedBody: parsedBody,
3620
+ exceptionCtor: __BaseException,
3621
+ errorCode: errorCode,
4206
3622
  });
4207
- throw __decorateServiceException(response, parsedBody);
3623
+ _d.label = 11;
3624
+ case 11: return [2];
4208
3625
  }
4209
3626
  });
4210
3627
  }); };
@@ -4216,28 +3633,26 @@ export var deserializeAws_restJson1ListGraphqlApisCommand = function (output, co
4216
3633
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4217
3634
  return [2, deserializeAws_restJson1ListGraphqlApisCommandError(output, context)];
4218
3635
  }
4219
- contents = {
3636
+ contents = map({
4220
3637
  $metadata: deserializeMetadata(output),
4221
- graphqlApis: undefined,
4222
- nextToken: undefined,
4223
- };
3638
+ });
4224
3639
  _a = __expectNonNull;
4225
3640
  _b = __expectObject;
4226
3641
  return [4, parseBody(output.body, context)];
4227
3642
  case 1:
4228
3643
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4229
- if (data.graphqlApis !== undefined && data.graphqlApis !== null) {
3644
+ if (data.graphqlApis != null) {
4230
3645
  contents.graphqlApis = deserializeAws_restJson1GraphqlApis(data.graphqlApis, context);
4231
3646
  }
4232
- if (data.nextToken !== undefined && data.nextToken !== null) {
3647
+ if (data.nextToken != null) {
4233
3648
  contents.nextToken = __expectString(data.nextToken);
4234
3649
  }
4235
- return [2, Promise.resolve(contents)];
3650
+ return [2, contents];
4236
3651
  }
4237
3652
  });
4238
3653
  }); };
4239
3654
  var deserializeAws_restJson1ListGraphqlApisCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4240
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3655
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4241
3656
  var _c;
4242
3657
  return __generator(this, function (_d) {
4243
3658
  switch (_d.label) {
@@ -4266,14 +3681,14 @@ var deserializeAws_restJson1ListGraphqlApisCommandError = function (output, cont
4266
3681
  case 7: throw _d.sent();
4267
3682
  case 8:
4268
3683
  parsedBody = parsedOutput.body;
4269
- $metadata = deserializeMetadata(output);
4270
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4271
- response = new __BaseException({
4272
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4273
- $fault: "client",
4274
- $metadata: $metadata,
3684
+ throwDefaultError({
3685
+ output: output,
3686
+ parsedBody: parsedBody,
3687
+ exceptionCtor: __BaseException,
3688
+ errorCode: errorCode,
4275
3689
  });
4276
- throw __decorateServiceException(response, parsedBody);
3690
+ _d.label = 9;
3691
+ case 9: return [2];
4277
3692
  }
4278
3693
  });
4279
3694
  }); };
@@ -4285,28 +3700,26 @@ export var deserializeAws_restJson1ListResolversCommand = function (output, cont
4285
3700
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4286
3701
  return [2, deserializeAws_restJson1ListResolversCommandError(output, context)];
4287
3702
  }
4288
- contents = {
3703
+ contents = map({
4289
3704
  $metadata: deserializeMetadata(output),
4290
- nextToken: undefined,
4291
- resolvers: undefined,
4292
- };
3705
+ });
4293
3706
  _a = __expectNonNull;
4294
3707
  _b = __expectObject;
4295
3708
  return [4, parseBody(output.body, context)];
4296
3709
  case 1:
4297
3710
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4298
- if (data.nextToken !== undefined && data.nextToken !== null) {
3711
+ if (data.nextToken != null) {
4299
3712
  contents.nextToken = __expectString(data.nextToken);
4300
3713
  }
4301
- if (data.resolvers !== undefined && data.resolvers !== null) {
3714
+ if (data.resolvers != null) {
4302
3715
  contents.resolvers = deserializeAws_restJson1Resolvers(data.resolvers, context);
4303
3716
  }
4304
- return [2, Promise.resolve(contents)];
3717
+ return [2, contents];
4305
3718
  }
4306
3719
  });
4307
3720
  }); };
4308
3721
  var deserializeAws_restJson1ListResolversCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4309
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3722
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4310
3723
  var _c;
4311
3724
  return __generator(this, function (_d) {
4312
3725
  switch (_d.label) {
@@ -4339,14 +3752,14 @@ var deserializeAws_restJson1ListResolversCommandError = function (output, contex
4339
3752
  case 9: throw _d.sent();
4340
3753
  case 10:
4341
3754
  parsedBody = parsedOutput.body;
4342
- $metadata = deserializeMetadata(output);
4343
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4344
- response = new __BaseException({
4345
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4346
- $fault: "client",
4347
- $metadata: $metadata,
3755
+ throwDefaultError({
3756
+ output: output,
3757
+ parsedBody: parsedBody,
3758
+ exceptionCtor: __BaseException,
3759
+ errorCode: errorCode,
4348
3760
  });
4349
- throw __decorateServiceException(response, parsedBody);
3761
+ _d.label = 11;
3762
+ case 11: return [2];
4350
3763
  }
4351
3764
  });
4352
3765
  }); };
@@ -4358,28 +3771,26 @@ export var deserializeAws_restJson1ListResolversByFunctionCommand = function (ou
4358
3771
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4359
3772
  return [2, deserializeAws_restJson1ListResolversByFunctionCommandError(output, context)];
4360
3773
  }
4361
- contents = {
3774
+ contents = map({
4362
3775
  $metadata: deserializeMetadata(output),
4363
- nextToken: undefined,
4364
- resolvers: undefined,
4365
- };
3776
+ });
4366
3777
  _a = __expectNonNull;
4367
3778
  _b = __expectObject;
4368
3779
  return [4, parseBody(output.body, context)];
4369
3780
  case 1:
4370
3781
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4371
- if (data.nextToken !== undefined && data.nextToken !== null) {
3782
+ if (data.nextToken != null) {
4372
3783
  contents.nextToken = __expectString(data.nextToken);
4373
3784
  }
4374
- if (data.resolvers !== undefined && data.resolvers !== null) {
3785
+ if (data.resolvers != null) {
4375
3786
  contents.resolvers = deserializeAws_restJson1Resolvers(data.resolvers, context);
4376
3787
  }
4377
- return [2, Promise.resolve(contents)];
3788
+ return [2, contents];
4378
3789
  }
4379
3790
  });
4380
3791
  }); };
4381
3792
  var deserializeAws_restJson1ListResolversByFunctionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4382
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3793
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4383
3794
  var _c;
4384
3795
  return __generator(this, function (_d) {
4385
3796
  switch (_d.label) {
@@ -4412,14 +3823,14 @@ var deserializeAws_restJson1ListResolversByFunctionCommandError = function (outp
4412
3823
  case 9: throw _d.sent();
4413
3824
  case 10:
4414
3825
  parsedBody = parsedOutput.body;
4415
- $metadata = deserializeMetadata(output);
4416
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4417
- response = new __BaseException({
4418
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4419
- $fault: "client",
4420
- $metadata: $metadata,
3826
+ throwDefaultError({
3827
+ output: output,
3828
+ parsedBody: parsedBody,
3829
+ exceptionCtor: __BaseException,
3830
+ errorCode: errorCode,
4421
3831
  });
4422
- throw __decorateServiceException(response, parsedBody);
3832
+ _d.label = 11;
3833
+ case 11: return [2];
4423
3834
  }
4424
3835
  });
4425
3836
  }); };
@@ -4431,24 +3842,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
4431
3842
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4432
3843
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
4433
3844
  }
4434
- contents = {
3845
+ contents = map({
4435
3846
  $metadata: deserializeMetadata(output),
4436
- tags: undefined,
4437
- };
3847
+ });
4438
3848
  _a = __expectNonNull;
4439
3849
  _b = __expectObject;
4440
3850
  return [4, parseBody(output.body, context)];
4441
3851
  case 1:
4442
3852
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4443
- if (data.tags !== undefined && data.tags !== null) {
3853
+ if (data.tags != null) {
4444
3854
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
4445
3855
  }
4446
- return [2, Promise.resolve(contents)];
3856
+ return [2, contents];
4447
3857
  }
4448
3858
  });
4449
3859
  }); };
4450
3860
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4451
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3861
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4452
3862
  var _c;
4453
3863
  return __generator(this, function (_d) {
4454
3864
  switch (_d.label) {
@@ -4489,14 +3899,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
4489
3899
  case 13: throw _d.sent();
4490
3900
  case 14:
4491
3901
  parsedBody = parsedOutput.body;
4492
- $metadata = deserializeMetadata(output);
4493
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4494
- response = new __BaseException({
4495
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4496
- $fault: "client",
4497
- $metadata: $metadata,
3902
+ throwDefaultError({
3903
+ output: output,
3904
+ parsedBody: parsedBody,
3905
+ exceptionCtor: __BaseException,
3906
+ errorCode: errorCode,
4498
3907
  });
4499
- throw __decorateServiceException(response, parsedBody);
3908
+ _d.label = 15;
3909
+ case 15: return [2];
4500
3910
  }
4501
3911
  });
4502
3912
  }); };
@@ -4508,28 +3918,26 @@ export var deserializeAws_restJson1ListTypesCommand = function (output, context)
4508
3918
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4509
3919
  return [2, deserializeAws_restJson1ListTypesCommandError(output, context)];
4510
3920
  }
4511
- contents = {
3921
+ contents = map({
4512
3922
  $metadata: deserializeMetadata(output),
4513
- nextToken: undefined,
4514
- types: undefined,
4515
- };
3923
+ });
4516
3924
  _a = __expectNonNull;
4517
3925
  _b = __expectObject;
4518
3926
  return [4, parseBody(output.body, context)];
4519
3927
  case 1:
4520
3928
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4521
- if (data.nextToken !== undefined && data.nextToken !== null) {
3929
+ if (data.nextToken != null) {
4522
3930
  contents.nextToken = __expectString(data.nextToken);
4523
3931
  }
4524
- if (data.types !== undefined && data.types !== null) {
3932
+ if (data.types != null) {
4525
3933
  contents.types = deserializeAws_restJson1TypeList(data.types, context);
4526
3934
  }
4527
- return [2, Promise.resolve(contents)];
3935
+ return [2, contents];
4528
3936
  }
4529
3937
  });
4530
3938
  }); };
4531
3939
  var deserializeAws_restJson1ListTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4532
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3940
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4533
3941
  var _c;
4534
3942
  return __generator(this, function (_d) {
4535
3943
  switch (_d.label) {
@@ -4566,14 +3974,14 @@ var deserializeAws_restJson1ListTypesCommandError = function (output, context) {
4566
3974
  case 11: throw _d.sent();
4567
3975
  case 12:
4568
3976
  parsedBody = parsedOutput.body;
4569
- $metadata = deserializeMetadata(output);
4570
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4571
- response = new __BaseException({
4572
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4573
- $fault: "client",
4574
- $metadata: $metadata,
3977
+ throwDefaultError({
3978
+ output: output,
3979
+ parsedBody: parsedBody,
3980
+ exceptionCtor: __BaseException,
3981
+ errorCode: errorCode,
4575
3982
  });
4576
- throw __decorateServiceException(response, parsedBody);
3983
+ _d.label = 13;
3984
+ case 13: return [2];
4577
3985
  }
4578
3986
  });
4579
3987
  }); };
@@ -4585,24 +3993,23 @@ export var deserializeAws_restJson1StartSchemaCreationCommand = function (output
4585
3993
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4586
3994
  return [2, deserializeAws_restJson1StartSchemaCreationCommandError(output, context)];
4587
3995
  }
4588
- contents = {
3996
+ contents = map({
4589
3997
  $metadata: deserializeMetadata(output),
4590
- status: undefined,
4591
- };
3998
+ });
4592
3999
  _a = __expectNonNull;
4593
4000
  _b = __expectObject;
4594
4001
  return [4, parseBody(output.body, context)];
4595
4002
  case 1:
4596
4003
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4597
- if (data.status !== undefined && data.status !== null) {
4004
+ if (data.status != null) {
4598
4005
  contents.status = __expectString(data.status);
4599
4006
  }
4600
- return [2, Promise.resolve(contents)];
4007
+ return [2, contents];
4601
4008
  }
4602
4009
  });
4603
4010
  }); };
4604
4011
  var deserializeAws_restJson1StartSchemaCreationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4605
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4012
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4606
4013
  var _c;
4607
4014
  return __generator(this, function (_d) {
4608
4015
  switch (_d.label) {
@@ -4639,14 +4046,14 @@ var deserializeAws_restJson1StartSchemaCreationCommandError = function (output,
4639
4046
  case 11: throw _d.sent();
4640
4047
  case 12:
4641
4048
  parsedBody = parsedOutput.body;
4642
- $metadata = deserializeMetadata(output);
4643
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4644
- response = new __BaseException({
4645
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4646
- $fault: "client",
4647
- $metadata: $metadata,
4049
+ throwDefaultError({
4050
+ output: output,
4051
+ parsedBody: parsedBody,
4052
+ exceptionCtor: __BaseException,
4053
+ errorCode: errorCode,
4648
4054
  });
4649
- throw __decorateServiceException(response, parsedBody);
4055
+ _d.label = 13;
4056
+ case 13: return [2];
4650
4057
  }
4651
4058
  });
4652
4059
  }); };
@@ -4658,18 +4065,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
4658
4065
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4659
4066
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
4660
4067
  }
4661
- contents = {
4068
+ contents = map({
4662
4069
  $metadata: deserializeMetadata(output),
4663
- };
4070
+ });
4664
4071
  return [4, collectBody(output.body, context)];
4665
4072
  case 1:
4666
4073
  _a.sent();
4667
- return [2, Promise.resolve(contents)];
4074
+ return [2, contents];
4668
4075
  }
4669
4076
  });
4670
4077
  }); };
4671
4078
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4672
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4079
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4673
4080
  var _c;
4674
4081
  return __generator(this, function (_d) {
4675
4082
  switch (_d.label) {
@@ -4710,14 +4117,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
4710
4117
  case 13: throw _d.sent();
4711
4118
  case 14:
4712
4119
  parsedBody = parsedOutput.body;
4713
- $metadata = deserializeMetadata(output);
4714
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4715
- response = new __BaseException({
4716
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4717
- $fault: "client",
4718
- $metadata: $metadata,
4120
+ throwDefaultError({
4121
+ output: output,
4122
+ parsedBody: parsedBody,
4123
+ exceptionCtor: __BaseException,
4124
+ errorCode: errorCode,
4719
4125
  });
4720
- throw __decorateServiceException(response, parsedBody);
4126
+ _d.label = 15;
4127
+ case 15: return [2];
4721
4128
  }
4722
4129
  });
4723
4130
  }); };
@@ -4729,18 +4136,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
4729
4136
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4730
4137
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
4731
4138
  }
4732
- contents = {
4139
+ contents = map({
4733
4140
  $metadata: deserializeMetadata(output),
4734
- };
4141
+ });
4735
4142
  return [4, collectBody(output.body, context)];
4736
4143
  case 1:
4737
4144
  _a.sent();
4738
- return [2, Promise.resolve(contents)];
4145
+ return [2, contents];
4739
4146
  }
4740
4147
  });
4741
4148
  }); };
4742
4149
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4743
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4150
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4744
4151
  var _c;
4745
4152
  return __generator(this, function (_d) {
4746
4153
  switch (_d.label) {
@@ -4781,14 +4188,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
4781
4188
  case 13: throw _d.sent();
4782
4189
  case 14:
4783
4190
  parsedBody = parsedOutput.body;
4784
- $metadata = deserializeMetadata(output);
4785
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4786
- response = new __BaseException({
4787
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4788
- $fault: "client",
4789
- $metadata: $metadata,
4191
+ throwDefaultError({
4192
+ output: output,
4193
+ parsedBody: parsedBody,
4194
+ exceptionCtor: __BaseException,
4195
+ errorCode: errorCode,
4790
4196
  });
4791
- throw __decorateServiceException(response, parsedBody);
4197
+ _d.label = 15;
4198
+ case 15: return [2];
4792
4199
  }
4793
4200
  });
4794
4201
  }); };
@@ -4800,24 +4207,23 @@ export var deserializeAws_restJson1UpdateApiCacheCommand = function (output, con
4800
4207
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4801
4208
  return [2, deserializeAws_restJson1UpdateApiCacheCommandError(output, context)];
4802
4209
  }
4803
- contents = {
4210
+ contents = map({
4804
4211
  $metadata: deserializeMetadata(output),
4805
- apiCache: undefined,
4806
- };
4212
+ });
4807
4213
  _a = __expectNonNull;
4808
4214
  _b = __expectObject;
4809
4215
  return [4, parseBody(output.body, context)];
4810
4216
  case 1:
4811
4217
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4812
- if (data.apiCache !== undefined && data.apiCache !== null) {
4218
+ if (data.apiCache != null) {
4813
4219
  contents.apiCache = deserializeAws_restJson1ApiCache(data.apiCache, context);
4814
4220
  }
4815
- return [2, Promise.resolve(contents)];
4221
+ return [2, contents];
4816
4222
  }
4817
4223
  });
4818
4224
  }); };
4819
4225
  var deserializeAws_restJson1UpdateApiCacheCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4820
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4226
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4821
4227
  var _c;
4822
4228
  return __generator(this, function (_d) {
4823
4229
  switch (_d.label) {
@@ -4854,14 +4260,14 @@ var deserializeAws_restJson1UpdateApiCacheCommandError = function (output, conte
4854
4260
  case 11: throw _d.sent();
4855
4261
  case 12:
4856
4262
  parsedBody = parsedOutput.body;
4857
- $metadata = deserializeMetadata(output);
4858
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4859
- response = new __BaseException({
4860
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4861
- $fault: "client",
4862
- $metadata: $metadata,
4263
+ throwDefaultError({
4264
+ output: output,
4265
+ parsedBody: parsedBody,
4266
+ exceptionCtor: __BaseException,
4267
+ errorCode: errorCode,
4863
4268
  });
4864
- throw __decorateServiceException(response, parsedBody);
4269
+ _d.label = 13;
4270
+ case 13: return [2];
4865
4271
  }
4866
4272
  });
4867
4273
  }); };
@@ -4873,24 +4279,23 @@ export var deserializeAws_restJson1UpdateApiKeyCommand = function (output, conte
4873
4279
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4874
4280
  return [2, deserializeAws_restJson1UpdateApiKeyCommandError(output, context)];
4875
4281
  }
4876
- contents = {
4282
+ contents = map({
4877
4283
  $metadata: deserializeMetadata(output),
4878
- apiKey: undefined,
4879
- };
4284
+ });
4880
4285
  _a = __expectNonNull;
4881
4286
  _b = __expectObject;
4882
4287
  return [4, parseBody(output.body, context)];
4883
4288
  case 1:
4884
4289
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4885
- if (data.apiKey !== undefined && data.apiKey !== null) {
4290
+ if (data.apiKey != null) {
4886
4291
  contents.apiKey = deserializeAws_restJson1ApiKey(data.apiKey, context);
4887
4292
  }
4888
- return [2, Promise.resolve(contents)];
4293
+ return [2, contents];
4889
4294
  }
4890
4295
  });
4891
4296
  }); };
4892
4297
  var deserializeAws_restJson1UpdateApiKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4893
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4298
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4894
4299
  var _c;
4895
4300
  return __generator(this, function (_d) {
4896
4301
  switch (_d.label) {
@@ -4931,14 +4336,14 @@ var deserializeAws_restJson1UpdateApiKeyCommandError = function (output, context
4931
4336
  case 13: throw _d.sent();
4932
4337
  case 14:
4933
4338
  parsedBody = parsedOutput.body;
4934
- $metadata = deserializeMetadata(output);
4935
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4936
- response = new __BaseException({
4937
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4938
- $fault: "client",
4939
- $metadata: $metadata,
4339
+ throwDefaultError({
4340
+ output: output,
4341
+ parsedBody: parsedBody,
4342
+ exceptionCtor: __BaseException,
4343
+ errorCode: errorCode,
4940
4344
  });
4941
- throw __decorateServiceException(response, parsedBody);
4345
+ _d.label = 15;
4346
+ case 15: return [2];
4942
4347
  }
4943
4348
  });
4944
4349
  }); };
@@ -4950,24 +4355,23 @@ export var deserializeAws_restJson1UpdateDataSourceCommand = function (output, c
4950
4355
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4951
4356
  return [2, deserializeAws_restJson1UpdateDataSourceCommandError(output, context)];
4952
4357
  }
4953
- contents = {
4358
+ contents = map({
4954
4359
  $metadata: deserializeMetadata(output),
4955
- dataSource: undefined,
4956
- };
4360
+ });
4957
4361
  _a = __expectNonNull;
4958
4362
  _b = __expectObject;
4959
4363
  return [4, parseBody(output.body, context)];
4960
4364
  case 1:
4961
4365
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4962
- if (data.dataSource !== undefined && data.dataSource !== null) {
4366
+ if (data.dataSource != null) {
4963
4367
  contents.dataSource = deserializeAws_restJson1DataSource(data.dataSource, context);
4964
4368
  }
4965
- return [2, Promise.resolve(contents)];
4369
+ return [2, contents];
4966
4370
  }
4967
4371
  });
4968
4372
  }); };
4969
4373
  var deserializeAws_restJson1UpdateDataSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4970
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4374
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4971
4375
  var _c;
4972
4376
  return __generator(this, function (_d) {
4973
4377
  switch (_d.label) {
@@ -5004,14 +4408,14 @@ var deserializeAws_restJson1UpdateDataSourceCommandError = function (output, con
5004
4408
  case 11: throw _d.sent();
5005
4409
  case 12:
5006
4410
  parsedBody = parsedOutput.body;
5007
- $metadata = deserializeMetadata(output);
5008
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
5009
- response = new __BaseException({
5010
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
5011
- $fault: "client",
5012
- $metadata: $metadata,
4411
+ throwDefaultError({
4412
+ output: output,
4413
+ parsedBody: parsedBody,
4414
+ exceptionCtor: __BaseException,
4415
+ errorCode: errorCode,
5013
4416
  });
5014
- throw __decorateServiceException(response, parsedBody);
4417
+ _d.label = 13;
4418
+ case 13: return [2];
5015
4419
  }
5016
4420
  });
5017
4421
  }); };
@@ -5023,24 +4427,23 @@ export var deserializeAws_restJson1UpdateDomainNameCommand = function (output, c
5023
4427
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5024
4428
  return [2, deserializeAws_restJson1UpdateDomainNameCommandError(output, context)];
5025
4429
  }
5026
- contents = {
4430
+ contents = map({
5027
4431
  $metadata: deserializeMetadata(output),
5028
- domainNameConfig: undefined,
5029
- };
4432
+ });
5030
4433
  _a = __expectNonNull;
5031
4434
  _b = __expectObject;
5032
4435
  return [4, parseBody(output.body, context)];
5033
4436
  case 1:
5034
4437
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
5035
- if (data.domainNameConfig !== undefined && data.domainNameConfig !== null) {
4438
+ if (data.domainNameConfig != null) {
5036
4439
  contents.domainNameConfig = deserializeAws_restJson1DomainNameConfig(data.domainNameConfig, context);
5037
4440
  }
5038
- return [2, Promise.resolve(contents)];
4441
+ return [2, contents];
5039
4442
  }
5040
4443
  });
5041
4444
  }); };
5042
4445
  var deserializeAws_restJson1UpdateDomainNameCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
5043
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4446
+ var parsedOutput, _a, errorCode, _b, parsedBody;
5044
4447
  var _c;
5045
4448
  return __generator(this, function (_d) {
5046
4449
  switch (_d.label) {
@@ -5077,14 +4480,14 @@ var deserializeAws_restJson1UpdateDomainNameCommandError = function (output, con
5077
4480
  case 11: throw _d.sent();
5078
4481
  case 12:
5079
4482
  parsedBody = parsedOutput.body;
5080
- $metadata = deserializeMetadata(output);
5081
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
5082
- response = new __BaseException({
5083
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
5084
- $fault: "client",
5085
- $metadata: $metadata,
4483
+ throwDefaultError({
4484
+ output: output,
4485
+ parsedBody: parsedBody,
4486
+ exceptionCtor: __BaseException,
4487
+ errorCode: errorCode,
5086
4488
  });
5087
- throw __decorateServiceException(response, parsedBody);
4489
+ _d.label = 13;
4490
+ case 13: return [2];
5088
4491
  }
5089
4492
  });
5090
4493
  }); };
@@ -5096,24 +4499,23 @@ export var deserializeAws_restJson1UpdateFunctionCommand = function (output, con
5096
4499
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5097
4500
  return [2, deserializeAws_restJson1UpdateFunctionCommandError(output, context)];
5098
4501
  }
5099
- contents = {
4502
+ contents = map({
5100
4503
  $metadata: deserializeMetadata(output),
5101
- functionConfiguration: undefined,
5102
- };
4504
+ });
5103
4505
  _a = __expectNonNull;
5104
4506
  _b = __expectObject;
5105
4507
  return [4, parseBody(output.body, context)];
5106
4508
  case 1:
5107
4509
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
5108
- if (data.functionConfiguration !== undefined && data.functionConfiguration !== null) {
4510
+ if (data.functionConfiguration != null) {
5109
4511
  contents.functionConfiguration = deserializeAws_restJson1FunctionConfiguration(data.functionConfiguration, context);
5110
4512
  }
5111
- return [2, Promise.resolve(contents)];
4513
+ return [2, contents];
5112
4514
  }
5113
4515
  });
5114
4516
  }); };
5115
4517
  var deserializeAws_restJson1UpdateFunctionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
5116
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4518
+ var parsedOutput, _a, errorCode, _b, parsedBody;
5117
4519
  var _c;
5118
4520
  return __generator(this, function (_d) {
5119
4521
  switch (_d.label) {
@@ -5146,14 +4548,14 @@ var deserializeAws_restJson1UpdateFunctionCommandError = function (output, conte
5146
4548
  case 9: throw _d.sent();
5147
4549
  case 10:
5148
4550
  parsedBody = parsedOutput.body;
5149
- $metadata = deserializeMetadata(output);
5150
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
5151
- response = new __BaseException({
5152
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
5153
- $fault: "client",
5154
- $metadata: $metadata,
4551
+ throwDefaultError({
4552
+ output: output,
4553
+ parsedBody: parsedBody,
4554
+ exceptionCtor: __BaseException,
4555
+ errorCode: errorCode,
5155
4556
  });
5156
- throw __decorateServiceException(response, parsedBody);
4557
+ _d.label = 11;
4558
+ case 11: return [2];
5157
4559
  }
5158
4560
  });
5159
4561
  }); };
@@ -5165,24 +4567,23 @@ export var deserializeAws_restJson1UpdateGraphqlApiCommand = function (output, c
5165
4567
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5166
4568
  return [2, deserializeAws_restJson1UpdateGraphqlApiCommandError(output, context)];
5167
4569
  }
5168
- contents = {
4570
+ contents = map({
5169
4571
  $metadata: deserializeMetadata(output),
5170
- graphqlApi: undefined,
5171
- };
4572
+ });
5172
4573
  _a = __expectNonNull;
5173
4574
  _b = __expectObject;
5174
4575
  return [4, parseBody(output.body, context)];
5175
4576
  case 1:
5176
4577
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
5177
- if (data.graphqlApi !== undefined && data.graphqlApi !== null) {
4578
+ if (data.graphqlApi != null) {
5178
4579
  contents.graphqlApi = deserializeAws_restJson1GraphqlApi(data.graphqlApi, context);
5179
4580
  }
5180
- return [2, Promise.resolve(contents)];
4581
+ return [2, contents];
5181
4582
  }
5182
4583
  });
5183
4584
  }); };
5184
4585
  var deserializeAws_restJson1UpdateGraphqlApiCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
5185
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4586
+ var parsedOutput, _a, errorCode, _b, parsedBody;
5186
4587
  var _c;
5187
4588
  return __generator(this, function (_d) {
5188
4589
  switch (_d.label) {
@@ -5223,14 +4624,14 @@ var deserializeAws_restJson1UpdateGraphqlApiCommandError = function (output, con
5223
4624
  case 13: throw _d.sent();
5224
4625
  case 14:
5225
4626
  parsedBody = parsedOutput.body;
5226
- $metadata = deserializeMetadata(output);
5227
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
5228
- response = new __BaseException({
5229
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
5230
- $fault: "client",
5231
- $metadata: $metadata,
4627
+ throwDefaultError({
4628
+ output: output,
4629
+ parsedBody: parsedBody,
4630
+ exceptionCtor: __BaseException,
4631
+ errorCode: errorCode,
5232
4632
  });
5233
- throw __decorateServiceException(response, parsedBody);
4633
+ _d.label = 15;
4634
+ case 15: return [2];
5234
4635
  }
5235
4636
  });
5236
4637
  }); };
@@ -5242,24 +4643,23 @@ export var deserializeAws_restJson1UpdateResolverCommand = function (output, con
5242
4643
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5243
4644
  return [2, deserializeAws_restJson1UpdateResolverCommandError(output, context)];
5244
4645
  }
5245
- contents = {
4646
+ contents = map({
5246
4647
  $metadata: deserializeMetadata(output),
5247
- resolver: undefined,
5248
- };
4648
+ });
5249
4649
  _a = __expectNonNull;
5250
4650
  _b = __expectObject;
5251
4651
  return [4, parseBody(output.body, context)];
5252
4652
  case 1:
5253
4653
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
5254
- if (data.resolver !== undefined && data.resolver !== null) {
4654
+ if (data.resolver != null) {
5255
4655
  contents.resolver = deserializeAws_restJson1Resolver(data.resolver, context);
5256
4656
  }
5257
- return [2, Promise.resolve(contents)];
4657
+ return [2, contents];
5258
4658
  }
5259
4659
  });
5260
4660
  }); };
5261
4661
  var deserializeAws_restJson1UpdateResolverCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
5262
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4662
+ var parsedOutput, _a, errorCode, _b, parsedBody;
5263
4663
  var _c;
5264
4664
  return __generator(this, function (_d) {
5265
4665
  switch (_d.label) {
@@ -5292,14 +4692,14 @@ var deserializeAws_restJson1UpdateResolverCommandError = function (output, conte
5292
4692
  case 9: throw _d.sent();
5293
4693
  case 10:
5294
4694
  parsedBody = parsedOutput.body;
5295
- $metadata = deserializeMetadata(output);
5296
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
5297
- response = new __BaseException({
5298
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
5299
- $fault: "client",
5300
- $metadata: $metadata,
4695
+ throwDefaultError({
4696
+ output: output,
4697
+ parsedBody: parsedBody,
4698
+ exceptionCtor: __BaseException,
4699
+ errorCode: errorCode,
5301
4700
  });
5302
- throw __decorateServiceException(response, parsedBody);
4701
+ _d.label = 11;
4702
+ case 11: return [2];
5303
4703
  }
5304
4704
  });
5305
4705
  }); };
@@ -5311,24 +4711,23 @@ export var deserializeAws_restJson1UpdateTypeCommand = function (output, context
5311
4711
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5312
4712
  return [2, deserializeAws_restJson1UpdateTypeCommandError(output, context)];
5313
4713
  }
5314
- contents = {
4714
+ contents = map({
5315
4715
  $metadata: deserializeMetadata(output),
5316
- type: undefined,
5317
- };
4716
+ });
5318
4717
  _a = __expectNonNull;
5319
4718
  _b = __expectObject;
5320
4719
  return [4, parseBody(output.body, context)];
5321
4720
  case 1:
5322
4721
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
5323
- if (data.type !== undefined && data.type !== null) {
4722
+ if (data.type != null) {
5324
4723
  contents.type = deserializeAws_restJson1Type(data.type, context);
5325
4724
  }
5326
- return [2, Promise.resolve(contents)];
4725
+ return [2, contents];
5327
4726
  }
5328
4727
  });
5329
4728
  }); };
5330
4729
  var deserializeAws_restJson1UpdateTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
5331
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4730
+ var parsedOutput, _a, errorCode, _b, parsedBody;
5332
4731
  var _c;
5333
4732
  return __generator(this, function (_d) {
5334
4733
  switch (_d.label) {
@@ -5365,23 +4764,24 @@ var deserializeAws_restJson1UpdateTypeCommandError = function (output, context)
5365
4764
  case 11: throw _d.sent();
5366
4765
  case 12:
5367
4766
  parsedBody = parsedOutput.body;
5368
- $metadata = deserializeMetadata(output);
5369
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
5370
- response = new __BaseException({
5371
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
5372
- $fault: "client",
5373
- $metadata: $metadata,
4767
+ throwDefaultError({
4768
+ output: output,
4769
+ parsedBody: parsedBody,
4770
+ exceptionCtor: __BaseException,
4771
+ errorCode: errorCode,
5374
4772
  });
5375
- throw __decorateServiceException(response, parsedBody);
4773
+ _d.label = 13;
4774
+ case 13: return [2];
5376
4775
  }
5377
4776
  });
5378
4777
  }); };
4778
+ var map = __map;
5379
4779
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5380
4780
  var contents, data, exception;
5381
4781
  return __generator(this, function (_a) {
5382
- contents = {};
4782
+ contents = map({});
5383
4783
  data = parsedOutput.body;
5384
- if (data.message !== undefined && data.message !== null) {
4784
+ if (data.message != null) {
5385
4785
  contents.message = __expectString(data.message);
5386
4786
  }
5387
4787
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5391,9 +4791,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
5391
4791
  var deserializeAws_restJson1ApiKeyLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5392
4792
  var contents, data, exception;
5393
4793
  return __generator(this, function (_a) {
5394
- contents = {};
4794
+ contents = map({});
5395
4795
  data = parsedOutput.body;
5396
- if (data.message !== undefined && data.message !== null) {
4796
+ if (data.message != null) {
5397
4797
  contents.message = __expectString(data.message);
5398
4798
  }
5399
4799
  exception = new ApiKeyLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5403,9 +4803,9 @@ var deserializeAws_restJson1ApiKeyLimitExceededExceptionResponse = function (par
5403
4803
  var deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5404
4804
  var contents, data, exception;
5405
4805
  return __generator(this, function (_a) {
5406
- contents = {};
4806
+ contents = map({});
5407
4807
  data = parsedOutput.body;
5408
- if (data.message !== undefined && data.message !== null) {
4808
+ if (data.message != null) {
5409
4809
  contents.message = __expectString(data.message);
5410
4810
  }
5411
4811
  exception = new ApiKeyValidityOutOfBoundsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5415,9 +4815,9 @@ var deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse = functio
5415
4815
  var deserializeAws_restJson1ApiLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5416
4816
  var contents, data, exception;
5417
4817
  return __generator(this, function (_a) {
5418
- contents = {};
4818
+ contents = map({});
5419
4819
  data = parsedOutput.body;
5420
- if (data.message !== undefined && data.message !== null) {
4820
+ if (data.message != null) {
5421
4821
  contents.message = __expectString(data.message);
5422
4822
  }
5423
4823
  exception = new ApiLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5427,9 +4827,9 @@ var deserializeAws_restJson1ApiLimitExceededExceptionResponse = function (parsed
5427
4827
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5428
4828
  var contents, data, exception;
5429
4829
  return __generator(this, function (_a) {
5430
- contents = {};
4830
+ contents = map({});
5431
4831
  data = parsedOutput.body;
5432
- if (data.message !== undefined && data.message !== null) {
4832
+ if (data.message != null) {
5433
4833
  contents.message = __expectString(data.message);
5434
4834
  }
5435
4835
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5439,9 +4839,9 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
5439
4839
  var deserializeAws_restJson1ConcurrentModificationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5440
4840
  var contents, data, exception;
5441
4841
  return __generator(this, function (_a) {
5442
- contents = {};
4842
+ contents = map({});
5443
4843
  data = parsedOutput.body;
5444
- if (data.message !== undefined && data.message !== null) {
4844
+ if (data.message != null) {
5445
4845
  contents.message = __expectString(data.message);
5446
4846
  }
5447
4847
  exception = new ConcurrentModificationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5451,9 +4851,9 @@ var deserializeAws_restJson1ConcurrentModificationExceptionResponse = function (
5451
4851
  var deserializeAws_restJson1GraphQLSchemaExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5452
4852
  var contents, data, exception;
5453
4853
  return __generator(this, function (_a) {
5454
- contents = {};
4854
+ contents = map({});
5455
4855
  data = parsedOutput.body;
5456
- if (data.message !== undefined && data.message !== null) {
4856
+ if (data.message != null) {
5457
4857
  contents.message = __expectString(data.message);
5458
4858
  }
5459
4859
  exception = new GraphQLSchemaException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5463,9 +4863,9 @@ var deserializeAws_restJson1GraphQLSchemaExceptionResponse = function (parsedOut
5463
4863
  var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5464
4864
  var contents, data, exception;
5465
4865
  return __generator(this, function (_a) {
5466
- contents = {};
4866
+ contents = map({});
5467
4867
  data = parsedOutput.body;
5468
- if (data.message !== undefined && data.message !== null) {
4868
+ if (data.message != null) {
5469
4869
  contents.message = __expectString(data.message);
5470
4870
  }
5471
4871
  exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5475,9 +4875,9 @@ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedO
5475
4875
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5476
4876
  var contents, data, exception;
5477
4877
  return __generator(this, function (_a) {
5478
- contents = {};
4878
+ contents = map({});
5479
4879
  data = parsedOutput.body;
5480
- if (data.message !== undefined && data.message !== null) {
4880
+ if (data.message != null) {
5481
4881
  contents.message = __expectString(data.message);
5482
4882
  }
5483
4883
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5487,9 +4887,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
5487
4887
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5488
4888
  var contents, data, exception;
5489
4889
  return __generator(this, function (_a) {
5490
- contents = {};
4890
+ contents = map({});
5491
4891
  data = parsedOutput.body;
5492
- if (data.message !== undefined && data.message !== null) {
4892
+ if (data.message != null) {
5493
4893
  contents.message = __expectString(data.message);
5494
4894
  }
5495
4895
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5499,9 +4899,9 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
5499
4899
  var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
5500
4900
  var contents, data, exception;
5501
4901
  return __generator(this, function (_a) {
5502
- contents = {};
4902
+ contents = map({});
5503
4903
  data = parsedOutput.body;
5504
- if (data.message !== undefined && data.message !== null) {
4904
+ if (data.message != null) {
5505
4905
  contents.message = __expectString(data.message);
5506
4906
  }
5507
4907
  exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -5521,9 +4921,6 @@ var serializeAws_restJson1AdditionalAuthenticationProviders = function (input, c
5521
4921
  return input
5522
4922
  .filter(function (e) { return e != null; })
5523
4923
  .map(function (entry) {
5524
- if (entry === null) {
5525
- return null;
5526
- }
5527
4924
  return serializeAws_restJson1AdditionalAuthenticationProvider(entry, context);
5528
4925
  });
5529
4926
  };
@@ -5542,9 +4939,6 @@ var serializeAws_restJson1CachingKeys = function (input, context) {
5542
4939
  return input
5543
4940
  .filter(function (e) { return e != null; })
5544
4941
  .map(function (entry) {
5545
- if (entry === null) {
5546
- return null;
5547
- }
5548
4942
  return entry;
5549
4943
  });
5550
4944
  };
@@ -5566,9 +4960,6 @@ var serializeAws_restJson1FunctionsIds = function (input, context) {
5566
4960
  return input
5567
4961
  .filter(function (e) { return e != null; })
5568
4962
  .map(function (entry) {
5569
- if (entry === null) {
5570
- return null;
5571
- }
5572
4963
  return entry;
5573
4964
  });
5574
4965
  };