@aws-sdk/client-dataexchange 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, isValidHostname as __isValidHostname, } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ import { convertMap, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { DataExchangeServiceException as __BaseException } from "../models/DataExchangeServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1CancelJobCommand = 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()];
@@ -12,16 +12,7 @@ export var serializeAws_restJson1CancelJobCommand = function (input, context) {
12
12
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
13
  headers = {};
14
14
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/jobs/{JobId}";
15
- if (input.JobId !== undefined) {
16
- labelValue = input.JobId;
17
- if (labelValue.length <= 0) {
18
- throw new Error("Empty value provided for input HTTP label: JobId.");
19
- }
20
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
21
- }
22
- else {
23
- throw new Error("No value provided for input HTTP label: JobId.");
24
- }
15
+ resolvedPath = __resolvedPath(resolvedPath, input, "JobId", function () { return input.JobId; }, "{JobId}", false);
25
16
  return [2, new __HttpRequest({
26
17
  protocol: protocol,
27
18
  hostname: hostname,
@@ -107,7 +98,7 @@ export var serializeAws_restJson1CreateJobCommand = function (input, context) {
107
98
  });
108
99
  }); };
109
100
  export var serializeAws_restJson1CreateRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
110
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
101
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
111
102
  return __generator(this, function (_c) {
112
103
  switch (_c.label) {
113
104
  case 0: return [4, context.endpoint()];
@@ -117,16 +108,7 @@ export var serializeAws_restJson1CreateRevisionCommand = function (input, contex
117
108
  "content-type": "application/json",
118
109
  };
119
110
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/data-sets/{DataSetId}/revisions";
120
- if (input.DataSetId !== undefined) {
121
- labelValue = input.DataSetId;
122
- if (labelValue.length <= 0) {
123
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
124
- }
125
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
126
- }
127
- else {
128
- throw new Error("No value provided for input HTTP label: DataSetId.");
129
- }
111
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
130
112
  body = JSON.stringify(__assign(__assign({}, (input.Comment != null && { Comment: input.Comment })), (input.Tags != null && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) })));
131
113
  return [2, new __HttpRequest({
132
114
  protocol: protocol,
@@ -141,7 +123,7 @@ export var serializeAws_restJson1CreateRevisionCommand = function (input, contex
141
123
  });
142
124
  }); };
143
125
  export var serializeAws_restJson1DeleteAssetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
144
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
126
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
145
127
  return __generator(this, function (_c) {
146
128
  switch (_c.label) {
147
129
  case 0: return [4, context.endpoint()];
@@ -150,36 +132,9 @@ export var serializeAws_restJson1DeleteAssetCommand = function (input, context)
150
132
  headers = {};
151
133
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
152
134
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}";
153
- if (input.AssetId !== undefined) {
154
- labelValue = input.AssetId;
155
- if (labelValue.length <= 0) {
156
- throw new Error("Empty value provided for input HTTP label: AssetId.");
157
- }
158
- resolvedPath = resolvedPath.replace("{AssetId}", __extendedEncodeURIComponent(labelValue));
159
- }
160
- else {
161
- throw new Error("No value provided for input HTTP label: AssetId.");
162
- }
163
- if (input.DataSetId !== undefined) {
164
- labelValue = input.DataSetId;
165
- if (labelValue.length <= 0) {
166
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
167
- }
168
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
169
- }
170
- else {
171
- throw new Error("No value provided for input HTTP label: DataSetId.");
172
- }
173
- if (input.RevisionId !== undefined) {
174
- labelValue = input.RevisionId;
175
- if (labelValue.length <= 0) {
176
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
177
- }
178
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
179
- }
180
- else {
181
- throw new Error("No value provided for input HTTP label: RevisionId.");
182
- }
135
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssetId", function () { return input.AssetId; }, "{AssetId}", false);
136
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
137
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
183
138
  return [2, new __HttpRequest({
184
139
  protocol: protocol,
185
140
  hostname: hostname,
@@ -193,7 +148,7 @@ export var serializeAws_restJson1DeleteAssetCommand = function (input, context)
193
148
  });
194
149
  }); };
195
150
  export var serializeAws_restJson1DeleteDataSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
196
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
151
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
197
152
  return __generator(this, function (_c) {
198
153
  switch (_c.label) {
199
154
  case 0: return [4, context.endpoint()];
@@ -201,16 +156,7 @@ export var serializeAws_restJson1DeleteDataSetCommand = function (input, context
201
156
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
202
157
  headers = {};
203
158
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/data-sets/{DataSetId}";
204
- if (input.DataSetId !== undefined) {
205
- labelValue = input.DataSetId;
206
- if (labelValue.length <= 0) {
207
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
208
- }
209
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
210
- }
211
- else {
212
- throw new Error("No value provided for input HTTP label: DataSetId.");
213
- }
159
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
214
160
  return [2, new __HttpRequest({
215
161
  protocol: protocol,
216
162
  hostname: hostname,
@@ -224,7 +170,7 @@ export var serializeAws_restJson1DeleteDataSetCommand = function (input, context
224
170
  });
225
171
  }); };
226
172
  export var serializeAws_restJson1DeleteEventActionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
227
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
173
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
228
174
  return __generator(this, function (_c) {
229
175
  switch (_c.label) {
230
176
  case 0: return [4, context.endpoint()];
@@ -232,16 +178,7 @@ export var serializeAws_restJson1DeleteEventActionCommand = function (input, con
232
178
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
233
179
  headers = {};
234
180
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/event-actions/{EventActionId}";
235
- if (input.EventActionId !== undefined) {
236
- labelValue = input.EventActionId;
237
- if (labelValue.length <= 0) {
238
- throw new Error("Empty value provided for input HTTP label: EventActionId.");
239
- }
240
- resolvedPath = resolvedPath.replace("{EventActionId}", __extendedEncodeURIComponent(labelValue));
241
- }
242
- else {
243
- throw new Error("No value provided for input HTTP label: EventActionId.");
244
- }
181
+ resolvedPath = __resolvedPath(resolvedPath, input, "EventActionId", function () { return input.EventActionId; }, "{EventActionId}", false);
245
182
  return [2, new __HttpRequest({
246
183
  protocol: protocol,
247
184
  hostname: hostname,
@@ -255,7 +192,7 @@ export var serializeAws_restJson1DeleteEventActionCommand = function (input, con
255
192
  });
256
193
  }); };
257
194
  export var serializeAws_restJson1DeleteRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
258
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
195
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
259
196
  return __generator(this, function (_c) {
260
197
  switch (_c.label) {
261
198
  case 0: return [4, context.endpoint()];
@@ -264,26 +201,8 @@ export var serializeAws_restJson1DeleteRevisionCommand = function (input, contex
264
201
  headers = {};
265
202
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
266
203
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}";
267
- if (input.DataSetId !== undefined) {
268
- labelValue = input.DataSetId;
269
- if (labelValue.length <= 0) {
270
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
271
- }
272
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
273
- }
274
- else {
275
- throw new Error("No value provided for input HTTP label: DataSetId.");
276
- }
277
- if (input.RevisionId !== undefined) {
278
- labelValue = input.RevisionId;
279
- if (labelValue.length <= 0) {
280
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
281
- }
282
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
283
- }
284
- else {
285
- throw new Error("No value provided for input HTTP label: RevisionId.");
286
- }
204
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
205
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
287
206
  return [2, new __HttpRequest({
288
207
  protocol: protocol,
289
208
  hostname: hostname,
@@ -297,7 +216,7 @@ export var serializeAws_restJson1DeleteRevisionCommand = function (input, contex
297
216
  });
298
217
  }); };
299
218
  export var serializeAws_restJson1GetAssetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
300
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
219
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
301
220
  return __generator(this, function (_c) {
302
221
  switch (_c.label) {
303
222
  case 0: return [4, context.endpoint()];
@@ -306,36 +225,9 @@ export var serializeAws_restJson1GetAssetCommand = function (input, context) { r
306
225
  headers = {};
307
226
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
308
227
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}";
309
- if (input.AssetId !== undefined) {
310
- labelValue = input.AssetId;
311
- if (labelValue.length <= 0) {
312
- throw new Error("Empty value provided for input HTTP label: AssetId.");
313
- }
314
- resolvedPath = resolvedPath.replace("{AssetId}", __extendedEncodeURIComponent(labelValue));
315
- }
316
- else {
317
- throw new Error("No value provided for input HTTP label: AssetId.");
318
- }
319
- if (input.DataSetId !== undefined) {
320
- labelValue = input.DataSetId;
321
- if (labelValue.length <= 0) {
322
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
323
- }
324
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
325
- }
326
- else {
327
- throw new Error("No value provided for input HTTP label: DataSetId.");
328
- }
329
- if (input.RevisionId !== undefined) {
330
- labelValue = input.RevisionId;
331
- if (labelValue.length <= 0) {
332
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
333
- }
334
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
335
- }
336
- else {
337
- throw new Error("No value provided for input HTTP label: RevisionId.");
338
- }
228
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssetId", function () { return input.AssetId; }, "{AssetId}", false);
229
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
230
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
339
231
  return [2, new __HttpRequest({
340
232
  protocol: protocol,
341
233
  hostname: hostname,
@@ -349,7 +241,7 @@ export var serializeAws_restJson1GetAssetCommand = function (input, context) { r
349
241
  });
350
242
  }); };
351
243
  export var serializeAws_restJson1GetDataSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
352
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
244
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
353
245
  return __generator(this, function (_c) {
354
246
  switch (_c.label) {
355
247
  case 0: return [4, context.endpoint()];
@@ -357,16 +249,7 @@ export var serializeAws_restJson1GetDataSetCommand = function (input, context) {
357
249
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
358
250
  headers = {};
359
251
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/data-sets/{DataSetId}";
360
- if (input.DataSetId !== undefined) {
361
- labelValue = input.DataSetId;
362
- if (labelValue.length <= 0) {
363
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
364
- }
365
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
366
- }
367
- else {
368
- throw new Error("No value provided for input HTTP label: DataSetId.");
369
- }
252
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
370
253
  return [2, new __HttpRequest({
371
254
  protocol: protocol,
372
255
  hostname: hostname,
@@ -380,7 +263,7 @@ export var serializeAws_restJson1GetDataSetCommand = function (input, context) {
380
263
  });
381
264
  }); };
382
265
  export var serializeAws_restJson1GetEventActionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
383
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
266
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
384
267
  return __generator(this, function (_c) {
385
268
  switch (_c.label) {
386
269
  case 0: return [4, context.endpoint()];
@@ -388,16 +271,7 @@ export var serializeAws_restJson1GetEventActionCommand = function (input, contex
388
271
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
389
272
  headers = {};
390
273
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/event-actions/{EventActionId}";
391
- if (input.EventActionId !== undefined) {
392
- labelValue = input.EventActionId;
393
- if (labelValue.length <= 0) {
394
- throw new Error("Empty value provided for input HTTP label: EventActionId.");
395
- }
396
- resolvedPath = resolvedPath.replace("{EventActionId}", __extendedEncodeURIComponent(labelValue));
397
- }
398
- else {
399
- throw new Error("No value provided for input HTTP label: EventActionId.");
400
- }
274
+ resolvedPath = __resolvedPath(resolvedPath, input, "EventActionId", function () { return input.EventActionId; }, "{EventActionId}", false);
401
275
  return [2, new __HttpRequest({
402
276
  protocol: protocol,
403
277
  hostname: hostname,
@@ -411,7 +285,7 @@ export var serializeAws_restJson1GetEventActionCommand = function (input, contex
411
285
  });
412
286
  }); };
413
287
  export var serializeAws_restJson1GetJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
414
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
288
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
415
289
  return __generator(this, function (_c) {
416
290
  switch (_c.label) {
417
291
  case 0: return [4, context.endpoint()];
@@ -419,16 +293,7 @@ export var serializeAws_restJson1GetJobCommand = function (input, context) { ret
419
293
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
420
294
  headers = {};
421
295
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/jobs/{JobId}";
422
- if (input.JobId !== undefined) {
423
- labelValue = input.JobId;
424
- if (labelValue.length <= 0) {
425
- throw new Error("Empty value provided for input HTTP label: JobId.");
426
- }
427
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
428
- }
429
- else {
430
- throw new Error("No value provided for input HTTP label: JobId.");
431
- }
296
+ resolvedPath = __resolvedPath(resolvedPath, input, "JobId", function () { return input.JobId; }, "{JobId}", false);
432
297
  return [2, new __HttpRequest({
433
298
  protocol: protocol,
434
299
  hostname: hostname,
@@ -442,7 +307,7 @@ export var serializeAws_restJson1GetJobCommand = function (input, context) { ret
442
307
  });
443
308
  }); };
444
309
  export var serializeAws_restJson1GetRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
445
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
310
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
446
311
  return __generator(this, function (_c) {
447
312
  switch (_c.label) {
448
313
  case 0: return [4, context.endpoint()];
@@ -451,26 +316,8 @@ export var serializeAws_restJson1GetRevisionCommand = function (input, context)
451
316
  headers = {};
452
317
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
453
318
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}";
454
- if (input.DataSetId !== undefined) {
455
- labelValue = input.DataSetId;
456
- if (labelValue.length <= 0) {
457
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
458
- }
459
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
460
- }
461
- else {
462
- throw new Error("No value provided for input HTTP label: DataSetId.");
463
- }
464
- if (input.RevisionId !== undefined) {
465
- labelValue = input.RevisionId;
466
- if (labelValue.length <= 0) {
467
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
468
- }
469
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
470
- }
471
- else {
472
- throw new Error("No value provided for input HTTP label: RevisionId.");
473
- }
319
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
320
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
474
321
  return [2, new __HttpRequest({
475
322
  protocol: protocol,
476
323
  hostname: hostname,
@@ -484,7 +331,7 @@ export var serializeAws_restJson1GetRevisionCommand = function (input, context)
484
331
  });
485
332
  }); };
486
333
  export var serializeAws_restJson1ListDataSetRevisionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
487
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
334
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
488
335
  return __generator(this, function (_c) {
489
336
  switch (_c.label) {
490
337
  case 0: return [4, context.endpoint()];
@@ -492,17 +339,11 @@ export var serializeAws_restJson1ListDataSetRevisionsCommand = function (input,
492
339
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
493
340
  headers = {};
494
341
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/data-sets/{DataSetId}/revisions";
495
- if (input.DataSetId !== undefined) {
496
- labelValue = input.DataSetId;
497
- if (labelValue.length <= 0) {
498
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
499
- }
500
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
501
- }
502
- else {
503
- throw new Error("No value provided for input HTTP label: DataSetId.");
504
- }
505
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
342
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
343
+ query = map({
344
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
345
+ nextToken: [, input.NextToken],
346
+ });
506
347
  return [2, new __HttpRequest({
507
348
  protocol: protocol,
508
349
  hostname: hostname,
@@ -525,7 +366,11 @@ export var serializeAws_restJson1ListDataSetsCommand = function (input, context)
525
366
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
526
367
  headers = {};
527
368
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/data-sets";
528
- query = __assign(__assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.Origin !== undefined && { origin: input.Origin }));
369
+ query = map({
370
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
371
+ nextToken: [, input.NextToken],
372
+ origin: [, input.Origin],
373
+ });
529
374
  return [2, new __HttpRequest({
530
375
  protocol: protocol,
531
376
  hostname: hostname,
@@ -548,7 +393,11 @@ export var serializeAws_restJson1ListEventActionsCommand = function (input, cont
548
393
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
549
394
  headers = {};
550
395
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/event-actions";
551
- query = __assign(__assign(__assign({}, (input.EventSourceId !== undefined && { eventSourceId: input.EventSourceId })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
396
+ query = map({
397
+ eventSourceId: [, input.EventSourceId],
398
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
399
+ nextToken: [, input.NextToken],
400
+ });
552
401
  return [2, new __HttpRequest({
553
402
  protocol: protocol,
554
403
  hostname: hostname,
@@ -571,7 +420,12 @@ export var serializeAws_restJson1ListJobsCommand = function (input, context) { r
571
420
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
572
421
  headers = {};
573
422
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/jobs";
574
- query = __assign(__assign(__assign(__assign({}, (input.DataSetId !== undefined && { dataSetId: input.DataSetId })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.RevisionId !== undefined && { revisionId: input.RevisionId }));
423
+ query = map({
424
+ dataSetId: [, input.DataSetId],
425
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
426
+ nextToken: [, input.NextToken],
427
+ revisionId: [, input.RevisionId],
428
+ });
575
429
  return [2, new __HttpRequest({
576
430
  protocol: protocol,
577
431
  hostname: hostname,
@@ -586,7 +440,7 @@ export var serializeAws_restJson1ListJobsCommand = function (input, context) { r
586
440
  });
587
441
  }); };
588
442
  export var serializeAws_restJson1ListRevisionAssetsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
589
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
443
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
590
444
  return __generator(this, function (_c) {
591
445
  switch (_c.label) {
592
446
  case 0: return [4, context.endpoint()];
@@ -595,27 +449,12 @@ export var serializeAws_restJson1ListRevisionAssetsCommand = function (input, co
595
449
  headers = {};
596
450
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
597
451
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets";
598
- if (input.DataSetId !== undefined) {
599
- labelValue = input.DataSetId;
600
- if (labelValue.length <= 0) {
601
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
602
- }
603
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
604
- }
605
- else {
606
- throw new Error("No value provided for input HTTP label: DataSetId.");
607
- }
608
- if (input.RevisionId !== undefined) {
609
- labelValue = input.RevisionId;
610
- if (labelValue.length <= 0) {
611
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
612
- }
613
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
614
- }
615
- else {
616
- throw new Error("No value provided for input HTTP label: RevisionId.");
617
- }
618
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
452
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
453
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
454
+ query = map({
455
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
456
+ nextToken: [, input.NextToken],
457
+ });
619
458
  return [2, new __HttpRequest({
620
459
  protocol: protocol,
621
460
  hostname: hostname,
@@ -630,7 +469,7 @@ export var serializeAws_restJson1ListRevisionAssetsCommand = function (input, co
630
469
  });
631
470
  }); };
632
471
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
633
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
472
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
634
473
  return __generator(this, function (_c) {
635
474
  switch (_c.label) {
636
475
  case 0: return [4, context.endpoint()];
@@ -638,16 +477,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
638
477
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
639
478
  headers = {};
640
479
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
641
- if (input.ResourceArn !== undefined) {
642
- labelValue = input.ResourceArn;
643
- if (labelValue.length <= 0) {
644
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
645
- }
646
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
647
- }
648
- else {
649
- throw new Error("No value provided for input HTTP label: ResourceArn.");
650
- }
480
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
651
481
  return [2, new __HttpRequest({
652
482
  protocol: protocol,
653
483
  hostname: hostname,
@@ -661,7 +491,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
661
491
  });
662
492
  }); };
663
493
  export var serializeAws_restJson1RevokeRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
664
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
494
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
665
495
  return __generator(this, function (_c) {
666
496
  switch (_c.label) {
667
497
  case 0: return [4, context.endpoint()];
@@ -672,26 +502,8 @@ export var serializeAws_restJson1RevokeRevisionCommand = function (input, contex
672
502
  };
673
503
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
674
504
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/revoke";
675
- if (input.DataSetId !== undefined) {
676
- labelValue = input.DataSetId;
677
- if (labelValue.length <= 0) {
678
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
679
- }
680
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
681
- }
682
- else {
683
- throw new Error("No value provided for input HTTP label: DataSetId.");
684
- }
685
- if (input.RevisionId !== undefined) {
686
- labelValue = input.RevisionId;
687
- if (labelValue.length <= 0) {
688
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
689
- }
690
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
691
- }
692
- else {
693
- throw new Error("No value provided for input HTTP label: RevisionId.");
694
- }
505
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
506
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
695
507
  body = JSON.stringify(__assign({}, (input.RevocationComment != null && { RevocationComment: input.RevocationComment })));
696
508
  return [2, new __HttpRequest({
697
509
  protocol: protocol,
@@ -712,13 +524,13 @@ export var serializeAws_restJson1SendApiAssetCommand = function (input, context)
712
524
  case 0: return [4, context.endpoint()];
713
525
  case 1:
714
526
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
715
- headers = __assign(__assign(__assign(__assign(__assign(__assign({ "content-type": "text/plain" }, (isSerializableHeaderValue(input.AssetId) && { "x-amzn-dataexchange-asset-id": input.AssetId })), (isSerializableHeaderValue(input.DataSetId) && { "x-amzn-dataexchange-data-set-id": input.DataSetId })), (isSerializableHeaderValue(input.Method) && { "x-amzn-dataexchange-http-method": input.Method })), (isSerializableHeaderValue(input.Path) && { "x-amzn-dataexchange-path": input.Path })), (isSerializableHeaderValue(input.RevisionId) && { "x-amzn-dataexchange-revision-id": input.RevisionId })), (input.RequestHeaders !== undefined &&
527
+ headers = map({}, isSerializableHeaderValue, __assign({ "content-type": "text/plain", "x-amzn-dataexchange-asset-id": input.AssetId, "x-amzn-dataexchange-data-set-id": input.DataSetId, "x-amzn-dataexchange-http-method": input.Method, "x-amzn-dataexchange-path": input.Path, "x-amzn-dataexchange-revision-id": input.RevisionId }, (input.RequestHeaders !== undefined &&
716
528
  Object.keys(input.RequestHeaders).reduce(function (acc, suffix) {
717
529
  var _a;
718
530
  return (__assign(__assign({}, acc), (_a = {}, _a["x-amzn-dataexchange-header-".concat(suffix.toLowerCase())] = input.RequestHeaders[suffix], _a)));
719
- }, {})));
531
+ }, {}))));
720
532
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1";
721
- query = __assign({}, (input.QueryStringParameters !== undefined && input.QueryStringParameters));
533
+ query = map(__assign({}, convertMap(input.QueryStringParameters)));
722
534
  if (input.Body !== undefined) {
723
535
  body = input.Body;
724
536
  }
@@ -745,7 +557,7 @@ export var serializeAws_restJson1SendApiAssetCommand = function (input, context)
745
557
  });
746
558
  }); };
747
559
  export var serializeAws_restJson1StartJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
748
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
560
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
749
561
  return __generator(this, function (_c) {
750
562
  switch (_c.label) {
751
563
  case 0: return [4, context.endpoint()];
@@ -753,16 +565,7 @@ export var serializeAws_restJson1StartJobCommand = function (input, context) { r
753
565
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
754
566
  headers = {};
755
567
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/jobs/{JobId}";
756
- if (input.JobId !== undefined) {
757
- labelValue = input.JobId;
758
- if (labelValue.length <= 0) {
759
- throw new Error("Empty value provided for input HTTP label: JobId.");
760
- }
761
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
762
- }
763
- else {
764
- throw new Error("No value provided for input HTTP label: JobId.");
765
- }
568
+ resolvedPath = __resolvedPath(resolvedPath, input, "JobId", function () { return input.JobId; }, "{JobId}", false);
766
569
  return [2, new __HttpRequest({
767
570
  protocol: protocol,
768
571
  hostname: hostname,
@@ -776,7 +579,7 @@ export var serializeAws_restJson1StartJobCommand = function (input, context) { r
776
579
  });
777
580
  }); };
778
581
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
779
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
582
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
780
583
  return __generator(this, function (_c) {
781
584
  switch (_c.label) {
782
585
  case 0: return [4, context.endpoint()];
@@ -786,16 +589,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
786
589
  "content-type": "application/json",
787
590
  };
788
591
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
789
- if (input.ResourceArn !== undefined) {
790
- labelValue = input.ResourceArn;
791
- if (labelValue.length <= 0) {
792
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
793
- }
794
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
795
- }
796
- else {
797
- throw new Error("No value provided for input HTTP label: ResourceArn.");
798
- }
592
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
799
593
  body = JSON.stringify(__assign({}, (input.Tags != null && { tags: serializeAws_restJson1MapOf__string(input.Tags, context) })));
800
594
  return [2, new __HttpRequest({
801
595
  protocol: protocol,
@@ -810,7 +604,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
810
604
  });
811
605
  }); };
812
606
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
813
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
607
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
814
608
  return __generator(this, function (_c) {
815
609
  switch (_c.label) {
816
610
  case 0: return [4, context.endpoint()];
@@ -818,17 +612,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
818
612
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
819
613
  headers = {};
820
614
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
821
- if (input.ResourceArn !== undefined) {
822
- labelValue = input.ResourceArn;
823
- if (labelValue.length <= 0) {
824
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
825
- }
826
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
827
- }
828
- else {
829
- throw new Error("No value provided for input HTTP label: ResourceArn.");
830
- }
831
- query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
615
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
616
+ query = map({
617
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
618
+ });
832
619
  return [2, new __HttpRequest({
833
620
  protocol: protocol,
834
621
  hostname: hostname,
@@ -843,7 +630,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
843
630
  });
844
631
  }); };
845
632
  export var serializeAws_restJson1UpdateAssetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
846
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
633
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
847
634
  return __generator(this, function (_c) {
848
635
  switch (_c.label) {
849
636
  case 0: return [4, context.endpoint()];
@@ -854,36 +641,9 @@ export var serializeAws_restJson1UpdateAssetCommand = function (input, context)
854
641
  };
855
642
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
856
643
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}";
857
- if (input.AssetId !== undefined) {
858
- labelValue = input.AssetId;
859
- if (labelValue.length <= 0) {
860
- throw new Error("Empty value provided for input HTTP label: AssetId.");
861
- }
862
- resolvedPath = resolvedPath.replace("{AssetId}", __extendedEncodeURIComponent(labelValue));
863
- }
864
- else {
865
- throw new Error("No value provided for input HTTP label: AssetId.");
866
- }
867
- if (input.DataSetId !== undefined) {
868
- labelValue = input.DataSetId;
869
- if (labelValue.length <= 0) {
870
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
871
- }
872
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
873
- }
874
- else {
875
- throw new Error("No value provided for input HTTP label: DataSetId.");
876
- }
877
- if (input.RevisionId !== undefined) {
878
- labelValue = input.RevisionId;
879
- if (labelValue.length <= 0) {
880
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
881
- }
882
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
883
- }
884
- else {
885
- throw new Error("No value provided for input HTTP label: RevisionId.");
886
- }
644
+ resolvedPath = __resolvedPath(resolvedPath, input, "AssetId", function () { return input.AssetId; }, "{AssetId}", false);
645
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
646
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
887
647
  body = JSON.stringify(__assign({}, (input.Name != null && { Name: input.Name })));
888
648
  return [2, new __HttpRequest({
889
649
  protocol: protocol,
@@ -898,7 +658,7 @@ export var serializeAws_restJson1UpdateAssetCommand = function (input, context)
898
658
  });
899
659
  }); };
900
660
  export var serializeAws_restJson1UpdateDataSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
901
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
661
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
902
662
  return __generator(this, function (_c) {
903
663
  switch (_c.label) {
904
664
  case 0: return [4, context.endpoint()];
@@ -908,16 +668,7 @@ export var serializeAws_restJson1UpdateDataSetCommand = function (input, context
908
668
  "content-type": "application/json",
909
669
  };
910
670
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/data-sets/{DataSetId}";
911
- if (input.DataSetId !== undefined) {
912
- labelValue = input.DataSetId;
913
- if (labelValue.length <= 0) {
914
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
915
- }
916
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
917
- }
918
- else {
919
- throw new Error("No value provided for input HTTP label: DataSetId.");
920
- }
671
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
921
672
  body = JSON.stringify(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })));
922
673
  return [2, new __HttpRequest({
923
674
  protocol: protocol,
@@ -932,7 +683,7 @@ export var serializeAws_restJson1UpdateDataSetCommand = function (input, context
932
683
  });
933
684
  }); };
934
685
  export var serializeAws_restJson1UpdateEventActionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
935
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
686
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
936
687
  return __generator(this, function (_c) {
937
688
  switch (_c.label) {
938
689
  case 0: return [4, context.endpoint()];
@@ -942,16 +693,7 @@ export var serializeAws_restJson1UpdateEventActionCommand = function (input, con
942
693
  "content-type": "application/json",
943
694
  };
944
695
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/event-actions/{EventActionId}";
945
- if (input.EventActionId !== undefined) {
946
- labelValue = input.EventActionId;
947
- if (labelValue.length <= 0) {
948
- throw new Error("Empty value provided for input HTTP label: EventActionId.");
949
- }
950
- resolvedPath = resolvedPath.replace("{EventActionId}", __extendedEncodeURIComponent(labelValue));
951
- }
952
- else {
953
- throw new Error("No value provided for input HTTP label: EventActionId.");
954
- }
696
+ resolvedPath = __resolvedPath(resolvedPath, input, "EventActionId", function () { return input.EventActionId; }, "{EventActionId}", false);
955
697
  body = JSON.stringify(__assign({}, (input.Action != null && { Action: serializeAws_restJson1Action(input.Action, context) })));
956
698
  return [2, new __HttpRequest({
957
699
  protocol: protocol,
@@ -966,7 +708,7 @@ export var serializeAws_restJson1UpdateEventActionCommand = function (input, con
966
708
  });
967
709
  }); };
968
710
  export var serializeAws_restJson1UpdateRevisionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
969
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
711
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
970
712
  return __generator(this, function (_c) {
971
713
  switch (_c.label) {
972
714
  case 0: return [4, context.endpoint()];
@@ -977,26 +719,8 @@ export var serializeAws_restJson1UpdateRevisionCommand = function (input, contex
977
719
  };
978
720
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
979
721
  "/v1/data-sets/{DataSetId}/revisions/{RevisionId}";
980
- if (input.DataSetId !== undefined) {
981
- labelValue = input.DataSetId;
982
- if (labelValue.length <= 0) {
983
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
984
- }
985
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
986
- }
987
- else {
988
- throw new Error("No value provided for input HTTP label: DataSetId.");
989
- }
990
- if (input.RevisionId !== undefined) {
991
- labelValue = input.RevisionId;
992
- if (labelValue.length <= 0) {
993
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
994
- }
995
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
996
- }
997
- else {
998
- throw new Error("No value provided for input HTTP label: RevisionId.");
999
- }
722
+ resolvedPath = __resolvedPath(resolvedPath, input, "DataSetId", function () { return input.DataSetId; }, "{DataSetId}", false);
723
+ resolvedPath = __resolvedPath(resolvedPath, input, "RevisionId", function () { return input.RevisionId; }, "{RevisionId}", false);
1000
724
  body = JSON.stringify(__assign(__assign({}, (input.Comment != null && { Comment: input.Comment })), (input.Finalized != null && { Finalized: input.Finalized })));
1001
725
  return [2, new __HttpRequest({
1002
726
  protocol: protocol,
@@ -1018,18 +742,18 @@ export var deserializeAws_restJson1CancelJobCommand = function (output, context)
1018
742
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1019
743
  return [2, deserializeAws_restJson1CancelJobCommandError(output, context)];
1020
744
  }
1021
- contents = {
745
+ contents = map({
1022
746
  $metadata: deserializeMetadata(output),
1023
- };
747
+ });
1024
748
  return [4, collectBody(output.body, context)];
1025
749
  case 1:
1026
750
  _a.sent();
1027
- return [2, Promise.resolve(contents)];
751
+ return [2, contents];
1028
752
  }
1029
753
  });
1030
754
  }); };
1031
755
  var deserializeAws_restJson1CancelJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1032
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
756
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1033
757
  var _c;
1034
758
  return __generator(this, function (_d) {
1035
759
  switch (_d.label) {
@@ -1066,14 +790,14 @@ var deserializeAws_restJson1CancelJobCommandError = function (output, context) {
1066
790
  case 11: throw _d.sent();
1067
791
  case 12:
1068
792
  parsedBody = parsedOutput.body;
1069
- $metadata = deserializeMetadata(output);
1070
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1071
- response = new __BaseException({
1072
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1073
- $fault: "client",
1074
- $metadata: $metadata,
793
+ throwDefaultError({
794
+ output: output,
795
+ parsedBody: parsedBody,
796
+ exceptionCtor: __BaseException,
797
+ errorCode: errorCode,
1075
798
  });
1076
- throw __decorateServiceException(response, parsedBody);
799
+ _d.label = 13;
800
+ case 13: return [2];
1077
801
  }
1078
802
  });
1079
803
  }); };
@@ -1085,64 +809,53 @@ export var deserializeAws_restJson1CreateDataSetCommand = function (output, cont
1085
809
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1086
810
  return [2, deserializeAws_restJson1CreateDataSetCommandError(output, context)];
1087
811
  }
1088
- contents = {
812
+ contents = map({
1089
813
  $metadata: deserializeMetadata(output),
1090
- Arn: undefined,
1091
- AssetType: undefined,
1092
- CreatedAt: undefined,
1093
- Description: undefined,
1094
- Id: undefined,
1095
- Name: undefined,
1096
- Origin: undefined,
1097
- OriginDetails: undefined,
1098
- SourceId: undefined,
1099
- Tags: undefined,
1100
- UpdatedAt: undefined,
1101
- };
814
+ });
1102
815
  _a = __expectNonNull;
1103
816
  _b = __expectObject;
1104
817
  return [4, parseBody(output.body, context)];
1105
818
  case 1:
1106
819
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1107
- if (data.Arn !== undefined && data.Arn !== null) {
820
+ if (data.Arn != null) {
1108
821
  contents.Arn = __expectString(data.Arn);
1109
822
  }
1110
- if (data.AssetType !== undefined && data.AssetType !== null) {
823
+ if (data.AssetType != null) {
1111
824
  contents.AssetType = __expectString(data.AssetType);
1112
825
  }
1113
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
826
+ if (data.CreatedAt != null) {
1114
827
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1115
828
  }
1116
- if (data.Description !== undefined && data.Description !== null) {
829
+ if (data.Description != null) {
1117
830
  contents.Description = __expectString(data.Description);
1118
831
  }
1119
- if (data.Id !== undefined && data.Id !== null) {
832
+ if (data.Id != null) {
1120
833
  contents.Id = __expectString(data.Id);
1121
834
  }
1122
- if (data.Name !== undefined && data.Name !== null) {
835
+ if (data.Name != null) {
1123
836
  contents.Name = __expectString(data.Name);
1124
837
  }
1125
- if (data.Origin !== undefined && data.Origin !== null) {
838
+ if (data.Origin != null) {
1126
839
  contents.Origin = __expectString(data.Origin);
1127
840
  }
1128
- if (data.OriginDetails !== undefined && data.OriginDetails !== null) {
841
+ if (data.OriginDetails != null) {
1129
842
  contents.OriginDetails = deserializeAws_restJson1OriginDetails(data.OriginDetails, context);
1130
843
  }
1131
- if (data.SourceId !== undefined && data.SourceId !== null) {
844
+ if (data.SourceId != null) {
1132
845
  contents.SourceId = __expectString(data.SourceId);
1133
846
  }
1134
- if (data.Tags !== undefined && data.Tags !== null) {
847
+ if (data.Tags != null) {
1135
848
  contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
1136
849
  }
1137
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
850
+ if (data.UpdatedAt != null) {
1138
851
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1139
852
  }
1140
- return [2, Promise.resolve(contents)];
853
+ return [2, contents];
1141
854
  }
1142
855
  });
1143
856
  }); };
1144
857
  var deserializeAws_restJson1CreateDataSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1145
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
858
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1146
859
  var _c;
1147
860
  return __generator(this, function (_d) {
1148
861
  switch (_d.label) {
@@ -1179,14 +892,14 @@ var deserializeAws_restJson1CreateDataSetCommandError = function (output, contex
1179
892
  case 11: throw _d.sent();
1180
893
  case 12:
1181
894
  parsedBody = parsedOutput.body;
1182
- $metadata = deserializeMetadata(output);
1183
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1184
- response = new __BaseException({
1185
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1186
- $fault: "client",
1187
- $metadata: $metadata,
895
+ throwDefaultError({
896
+ output: output,
897
+ parsedBody: parsedBody,
898
+ exceptionCtor: __BaseException,
899
+ errorCode: errorCode,
1188
900
  });
1189
- throw __decorateServiceException(response, parsedBody);
901
+ _d.label = 13;
902
+ case 13: return [2];
1190
903
  }
1191
904
  });
1192
905
  }); };
@@ -1198,44 +911,38 @@ export var deserializeAws_restJson1CreateEventActionCommand = function (output,
1198
911
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1199
912
  return [2, deserializeAws_restJson1CreateEventActionCommandError(output, context)];
1200
913
  }
1201
- contents = {
914
+ contents = map({
1202
915
  $metadata: deserializeMetadata(output),
1203
- Action: undefined,
1204
- Arn: undefined,
1205
- CreatedAt: undefined,
1206
- Event: undefined,
1207
- Id: undefined,
1208
- UpdatedAt: undefined,
1209
- };
916
+ });
1210
917
  _a = __expectNonNull;
1211
918
  _b = __expectObject;
1212
919
  return [4, parseBody(output.body, context)];
1213
920
  case 1:
1214
921
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1215
- if (data.Action !== undefined && data.Action !== null) {
922
+ if (data.Action != null) {
1216
923
  contents.Action = deserializeAws_restJson1Action(data.Action, context);
1217
924
  }
1218
- if (data.Arn !== undefined && data.Arn !== null) {
925
+ if (data.Arn != null) {
1219
926
  contents.Arn = __expectString(data.Arn);
1220
927
  }
1221
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
928
+ if (data.CreatedAt != null) {
1222
929
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1223
930
  }
1224
- if (data.Event !== undefined && data.Event !== null) {
931
+ if (data.Event != null) {
1225
932
  contents.Event = deserializeAws_restJson1Event(data.Event, context);
1226
933
  }
1227
- if (data.Id !== undefined && data.Id !== null) {
934
+ if (data.Id != null) {
1228
935
  contents.Id = __expectString(data.Id);
1229
936
  }
1230
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
937
+ if (data.UpdatedAt != null) {
1231
938
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1232
939
  }
1233
- return [2, Promise.resolve(contents)];
940
+ return [2, contents];
1234
941
  }
1235
942
  });
1236
943
  }); };
1237
944
  var deserializeAws_restJson1CreateEventActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1238
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
945
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1239
946
  var _c;
1240
947
  return __generator(this, function (_d) {
1241
948
  switch (_d.label) {
@@ -1272,14 +979,14 @@ var deserializeAws_restJson1CreateEventActionCommandError = function (output, co
1272
979
  case 11: throw _d.sent();
1273
980
  case 12:
1274
981
  parsedBody = parsedOutput.body;
1275
- $metadata = deserializeMetadata(output);
1276
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1277
- response = new __BaseException({
1278
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1279
- $fault: "client",
1280
- $metadata: $metadata,
982
+ throwDefaultError({
983
+ output: output,
984
+ parsedBody: parsedBody,
985
+ exceptionCtor: __BaseException,
986
+ errorCode: errorCode,
1281
987
  });
1282
- throw __decorateServiceException(response, parsedBody);
988
+ _d.label = 13;
989
+ case 13: return [2];
1283
990
  }
1284
991
  });
1285
992
  }); };
@@ -1291,52 +998,44 @@ export var deserializeAws_restJson1CreateJobCommand = function (output, context)
1291
998
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1292
999
  return [2, deserializeAws_restJson1CreateJobCommandError(output, context)];
1293
1000
  }
1294
- contents = {
1001
+ contents = map({
1295
1002
  $metadata: deserializeMetadata(output),
1296
- Arn: undefined,
1297
- CreatedAt: undefined,
1298
- Details: undefined,
1299
- Errors: undefined,
1300
- Id: undefined,
1301
- State: undefined,
1302
- Type: undefined,
1303
- UpdatedAt: undefined,
1304
- };
1003
+ });
1305
1004
  _a = __expectNonNull;
1306
1005
  _b = __expectObject;
1307
1006
  return [4, parseBody(output.body, context)];
1308
1007
  case 1:
1309
1008
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1310
- if (data.Arn !== undefined && data.Arn !== null) {
1009
+ if (data.Arn != null) {
1311
1010
  contents.Arn = __expectString(data.Arn);
1312
1011
  }
1313
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1012
+ if (data.CreatedAt != null) {
1314
1013
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1315
1014
  }
1316
- if (data.Details !== undefined && data.Details !== null) {
1015
+ if (data.Details != null) {
1317
1016
  contents.Details = deserializeAws_restJson1ResponseDetails(data.Details, context);
1318
1017
  }
1319
- if (data.Errors !== undefined && data.Errors !== null) {
1018
+ if (data.Errors != null) {
1320
1019
  contents.Errors = deserializeAws_restJson1ListOfJobError(data.Errors, context);
1321
1020
  }
1322
- if (data.Id !== undefined && data.Id !== null) {
1021
+ if (data.Id != null) {
1323
1022
  contents.Id = __expectString(data.Id);
1324
1023
  }
1325
- if (data.State !== undefined && data.State !== null) {
1024
+ if (data.State != null) {
1326
1025
  contents.State = __expectString(data.State);
1327
1026
  }
1328
- if (data.Type !== undefined && data.Type !== null) {
1027
+ if (data.Type != null) {
1329
1028
  contents.Type = __expectString(data.Type);
1330
1029
  }
1331
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1030
+ if (data.UpdatedAt != null) {
1332
1031
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1333
1032
  }
1334
- return [2, Promise.resolve(contents)];
1033
+ return [2, contents];
1335
1034
  }
1336
1035
  });
1337
1036
  }); };
1338
1037
  var deserializeAws_restJson1CreateJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1339
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1038
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1340
1039
  var _c;
1341
1040
  return __generator(this, function (_d) {
1342
1041
  switch (_d.label) {
@@ -1377,14 +1076,14 @@ var deserializeAws_restJson1CreateJobCommandError = function (output, context) {
1377
1076
  case 13: throw _d.sent();
1378
1077
  case 14:
1379
1078
  parsedBody = parsedOutput.body;
1380
- $metadata = deserializeMetadata(output);
1381
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1382
- response = new __BaseException({
1383
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1384
- $fault: "client",
1385
- $metadata: $metadata,
1079
+ throwDefaultError({
1080
+ output: output,
1081
+ parsedBody: parsedBody,
1082
+ exceptionCtor: __BaseException,
1083
+ errorCode: errorCode,
1386
1084
  });
1387
- throw __decorateServiceException(response, parsedBody);
1085
+ _d.label = 15;
1086
+ case 15: return [2];
1388
1087
  }
1389
1088
  });
1390
1089
  }); };
@@ -1396,68 +1095,56 @@ export var deserializeAws_restJson1CreateRevisionCommand = function (output, con
1396
1095
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1397
1096
  return [2, deserializeAws_restJson1CreateRevisionCommandError(output, context)];
1398
1097
  }
1399
- contents = {
1098
+ contents = map({
1400
1099
  $metadata: deserializeMetadata(output),
1401
- Arn: undefined,
1402
- Comment: undefined,
1403
- CreatedAt: undefined,
1404
- DataSetId: undefined,
1405
- Finalized: undefined,
1406
- Id: undefined,
1407
- RevocationComment: undefined,
1408
- Revoked: undefined,
1409
- RevokedAt: undefined,
1410
- SourceId: undefined,
1411
- Tags: undefined,
1412
- UpdatedAt: undefined,
1413
- };
1100
+ });
1414
1101
  _a = __expectNonNull;
1415
1102
  _b = __expectObject;
1416
1103
  return [4, parseBody(output.body, context)];
1417
1104
  case 1:
1418
1105
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1419
- if (data.Arn !== undefined && data.Arn !== null) {
1106
+ if (data.Arn != null) {
1420
1107
  contents.Arn = __expectString(data.Arn);
1421
1108
  }
1422
- if (data.Comment !== undefined && data.Comment !== null) {
1109
+ if (data.Comment != null) {
1423
1110
  contents.Comment = __expectString(data.Comment);
1424
1111
  }
1425
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1112
+ if (data.CreatedAt != null) {
1426
1113
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1427
1114
  }
1428
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
1115
+ if (data.DataSetId != null) {
1429
1116
  contents.DataSetId = __expectString(data.DataSetId);
1430
1117
  }
1431
- if (data.Finalized !== undefined && data.Finalized !== null) {
1118
+ if (data.Finalized != null) {
1432
1119
  contents.Finalized = __expectBoolean(data.Finalized);
1433
1120
  }
1434
- if (data.Id !== undefined && data.Id !== null) {
1121
+ if (data.Id != null) {
1435
1122
  contents.Id = __expectString(data.Id);
1436
1123
  }
1437
- if (data.RevocationComment !== undefined && data.RevocationComment !== null) {
1124
+ if (data.RevocationComment != null) {
1438
1125
  contents.RevocationComment = __expectString(data.RevocationComment);
1439
1126
  }
1440
- if (data.Revoked !== undefined && data.Revoked !== null) {
1127
+ if (data.Revoked != null) {
1441
1128
  contents.Revoked = __expectBoolean(data.Revoked);
1442
1129
  }
1443
- if (data.RevokedAt !== undefined && data.RevokedAt !== null) {
1130
+ if (data.RevokedAt != null) {
1444
1131
  contents.RevokedAt = __expectNonNull(__parseRfc3339DateTime(data.RevokedAt));
1445
1132
  }
1446
- if (data.SourceId !== undefined && data.SourceId !== null) {
1133
+ if (data.SourceId != null) {
1447
1134
  contents.SourceId = __expectString(data.SourceId);
1448
1135
  }
1449
- if (data.Tags !== undefined && data.Tags !== null) {
1136
+ if (data.Tags != null) {
1450
1137
  contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
1451
1138
  }
1452
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1139
+ if (data.UpdatedAt != null) {
1453
1140
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1454
1141
  }
1455
- return [2, Promise.resolve(contents)];
1142
+ return [2, contents];
1456
1143
  }
1457
1144
  });
1458
1145
  }); };
1459
1146
  var deserializeAws_restJson1CreateRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1460
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1147
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1461
1148
  var _c;
1462
1149
  return __generator(this, function (_d) {
1463
1150
  switch (_d.label) {
@@ -1494,14 +1181,14 @@ var deserializeAws_restJson1CreateRevisionCommandError = function (output, conte
1494
1181
  case 11: throw _d.sent();
1495
1182
  case 12:
1496
1183
  parsedBody = parsedOutput.body;
1497
- $metadata = deserializeMetadata(output);
1498
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1499
- response = new __BaseException({
1500
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1501
- $fault: "client",
1502
- $metadata: $metadata,
1184
+ throwDefaultError({
1185
+ output: output,
1186
+ parsedBody: parsedBody,
1187
+ exceptionCtor: __BaseException,
1188
+ errorCode: errorCode,
1503
1189
  });
1504
- throw __decorateServiceException(response, parsedBody);
1190
+ _d.label = 13;
1191
+ case 13: return [2];
1505
1192
  }
1506
1193
  });
1507
1194
  }); };
@@ -1513,18 +1200,18 @@ export var deserializeAws_restJson1DeleteAssetCommand = function (output, contex
1513
1200
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1514
1201
  return [2, deserializeAws_restJson1DeleteAssetCommandError(output, context)];
1515
1202
  }
1516
- contents = {
1203
+ contents = map({
1517
1204
  $metadata: deserializeMetadata(output),
1518
- };
1205
+ });
1519
1206
  return [4, collectBody(output.body, context)];
1520
1207
  case 1:
1521
1208
  _a.sent();
1522
- return [2, Promise.resolve(contents)];
1209
+ return [2, contents];
1523
1210
  }
1524
1211
  });
1525
1212
  }); };
1526
1213
  var deserializeAws_restJson1DeleteAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1527
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1214
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1528
1215
  var _c;
1529
1216
  return __generator(this, function (_d) {
1530
1217
  switch (_d.label) {
@@ -1565,14 +1252,14 @@ var deserializeAws_restJson1DeleteAssetCommandError = function (output, context)
1565
1252
  case 13: throw _d.sent();
1566
1253
  case 14:
1567
1254
  parsedBody = parsedOutput.body;
1568
- $metadata = deserializeMetadata(output);
1569
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1570
- response = new __BaseException({
1571
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1572
- $fault: "client",
1573
- $metadata: $metadata,
1255
+ throwDefaultError({
1256
+ output: output,
1257
+ parsedBody: parsedBody,
1258
+ exceptionCtor: __BaseException,
1259
+ errorCode: errorCode,
1574
1260
  });
1575
- throw __decorateServiceException(response, parsedBody);
1261
+ _d.label = 15;
1262
+ case 15: return [2];
1576
1263
  }
1577
1264
  });
1578
1265
  }); };
@@ -1584,18 +1271,18 @@ export var deserializeAws_restJson1DeleteDataSetCommand = function (output, cont
1584
1271
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1585
1272
  return [2, deserializeAws_restJson1DeleteDataSetCommandError(output, context)];
1586
1273
  }
1587
- contents = {
1274
+ contents = map({
1588
1275
  $metadata: deserializeMetadata(output),
1589
- };
1276
+ });
1590
1277
  return [4, collectBody(output.body, context)];
1591
1278
  case 1:
1592
1279
  _a.sent();
1593
- return [2, Promise.resolve(contents)];
1280
+ return [2, contents];
1594
1281
  }
1595
1282
  });
1596
1283
  }); };
1597
1284
  var deserializeAws_restJson1DeleteDataSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1598
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1285
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1599
1286
  var _c;
1600
1287
  return __generator(this, function (_d) {
1601
1288
  switch (_d.label) {
@@ -1636,14 +1323,14 @@ var deserializeAws_restJson1DeleteDataSetCommandError = function (output, contex
1636
1323
  case 13: throw _d.sent();
1637
1324
  case 14:
1638
1325
  parsedBody = parsedOutput.body;
1639
- $metadata = deserializeMetadata(output);
1640
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1641
- response = new __BaseException({
1642
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1643
- $fault: "client",
1644
- $metadata: $metadata,
1326
+ throwDefaultError({
1327
+ output: output,
1328
+ parsedBody: parsedBody,
1329
+ exceptionCtor: __BaseException,
1330
+ errorCode: errorCode,
1645
1331
  });
1646
- throw __decorateServiceException(response, parsedBody);
1332
+ _d.label = 15;
1333
+ case 15: return [2];
1647
1334
  }
1648
1335
  });
1649
1336
  }); };
@@ -1655,18 +1342,18 @@ export var deserializeAws_restJson1DeleteEventActionCommand = function (output,
1655
1342
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1656
1343
  return [2, deserializeAws_restJson1DeleteEventActionCommandError(output, context)];
1657
1344
  }
1658
- contents = {
1345
+ contents = map({
1659
1346
  $metadata: deserializeMetadata(output),
1660
- };
1347
+ });
1661
1348
  return [4, collectBody(output.body, context)];
1662
1349
  case 1:
1663
1350
  _a.sent();
1664
- return [2, Promise.resolve(contents)];
1351
+ return [2, contents];
1665
1352
  }
1666
1353
  });
1667
1354
  }); };
1668
1355
  var deserializeAws_restJson1DeleteEventActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1669
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1356
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1670
1357
  var _c;
1671
1358
  return __generator(this, function (_d) {
1672
1359
  switch (_d.label) {
@@ -1699,14 +1386,14 @@ var deserializeAws_restJson1DeleteEventActionCommandError = function (output, co
1699
1386
  case 9: throw _d.sent();
1700
1387
  case 10:
1701
1388
  parsedBody = parsedOutput.body;
1702
- $metadata = deserializeMetadata(output);
1703
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1704
- response = new __BaseException({
1705
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1706
- $fault: "client",
1707
- $metadata: $metadata,
1389
+ throwDefaultError({
1390
+ output: output,
1391
+ parsedBody: parsedBody,
1392
+ exceptionCtor: __BaseException,
1393
+ errorCode: errorCode,
1708
1394
  });
1709
- throw __decorateServiceException(response, parsedBody);
1395
+ _d.label = 11;
1396
+ case 11: return [2];
1710
1397
  }
1711
1398
  });
1712
1399
  }); };
@@ -1718,18 +1405,18 @@ export var deserializeAws_restJson1DeleteRevisionCommand = function (output, con
1718
1405
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1719
1406
  return [2, deserializeAws_restJson1DeleteRevisionCommandError(output, context)];
1720
1407
  }
1721
- contents = {
1408
+ contents = map({
1722
1409
  $metadata: deserializeMetadata(output),
1723
- };
1410
+ });
1724
1411
  return [4, collectBody(output.body, context)];
1725
1412
  case 1:
1726
1413
  _a.sent();
1727
- return [2, Promise.resolve(contents)];
1414
+ return [2, contents];
1728
1415
  }
1729
1416
  });
1730
1417
  }); };
1731
1418
  var deserializeAws_restJson1DeleteRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1732
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1419
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1733
1420
  var _c;
1734
1421
  return __generator(this, function (_d) {
1735
1422
  switch (_d.label) {
@@ -1770,14 +1457,14 @@ var deserializeAws_restJson1DeleteRevisionCommandError = function (output, conte
1770
1457
  case 13: throw _d.sent();
1771
1458
  case 14:
1772
1459
  parsedBody = parsedOutput.body;
1773
- $metadata = deserializeMetadata(output);
1774
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1775
- response = new __BaseException({
1776
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1777
- $fault: "client",
1778
- $metadata: $metadata,
1460
+ throwDefaultError({
1461
+ output: output,
1462
+ parsedBody: parsedBody,
1463
+ exceptionCtor: __BaseException,
1464
+ errorCode: errorCode,
1779
1465
  });
1780
- throw __decorateServiceException(response, parsedBody);
1466
+ _d.label = 15;
1467
+ case 15: return [2];
1781
1468
  }
1782
1469
  });
1783
1470
  }); };
@@ -1789,60 +1476,50 @@ export var deserializeAws_restJson1GetAssetCommand = function (output, context)
1789
1476
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1790
1477
  return [2, deserializeAws_restJson1GetAssetCommandError(output, context)];
1791
1478
  }
1792
- contents = {
1479
+ contents = map({
1793
1480
  $metadata: deserializeMetadata(output),
1794
- Arn: undefined,
1795
- AssetDetails: undefined,
1796
- AssetType: undefined,
1797
- CreatedAt: undefined,
1798
- DataSetId: undefined,
1799
- Id: undefined,
1800
- Name: undefined,
1801
- RevisionId: undefined,
1802
- SourceId: undefined,
1803
- UpdatedAt: undefined,
1804
- };
1481
+ });
1805
1482
  _a = __expectNonNull;
1806
1483
  _b = __expectObject;
1807
1484
  return [4, parseBody(output.body, context)];
1808
1485
  case 1:
1809
1486
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1810
- if (data.Arn !== undefined && data.Arn !== null) {
1487
+ if (data.Arn != null) {
1811
1488
  contents.Arn = __expectString(data.Arn);
1812
1489
  }
1813
- if (data.AssetDetails !== undefined && data.AssetDetails !== null) {
1490
+ if (data.AssetDetails != null) {
1814
1491
  contents.AssetDetails = deserializeAws_restJson1AssetDetails(data.AssetDetails, context);
1815
1492
  }
1816
- if (data.AssetType !== undefined && data.AssetType !== null) {
1493
+ if (data.AssetType != null) {
1817
1494
  contents.AssetType = __expectString(data.AssetType);
1818
1495
  }
1819
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1496
+ if (data.CreatedAt != null) {
1820
1497
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1821
1498
  }
1822
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
1499
+ if (data.DataSetId != null) {
1823
1500
  contents.DataSetId = __expectString(data.DataSetId);
1824
1501
  }
1825
- if (data.Id !== undefined && data.Id !== null) {
1502
+ if (data.Id != null) {
1826
1503
  contents.Id = __expectString(data.Id);
1827
1504
  }
1828
- if (data.Name !== undefined && data.Name !== null) {
1505
+ if (data.Name != null) {
1829
1506
  contents.Name = __expectString(data.Name);
1830
1507
  }
1831
- if (data.RevisionId !== undefined && data.RevisionId !== null) {
1508
+ if (data.RevisionId != null) {
1832
1509
  contents.RevisionId = __expectString(data.RevisionId);
1833
1510
  }
1834
- if (data.SourceId !== undefined && data.SourceId !== null) {
1511
+ if (data.SourceId != null) {
1835
1512
  contents.SourceId = __expectString(data.SourceId);
1836
1513
  }
1837
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1514
+ if (data.UpdatedAt != null) {
1838
1515
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1839
1516
  }
1840
- return [2, Promise.resolve(contents)];
1517
+ return [2, contents];
1841
1518
  }
1842
1519
  });
1843
1520
  }); };
1844
1521
  var deserializeAws_restJson1GetAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1845
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1522
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1846
1523
  var _c;
1847
1524
  return __generator(this, function (_d) {
1848
1525
  switch (_d.label) {
@@ -1875,14 +1552,14 @@ var deserializeAws_restJson1GetAssetCommandError = function (output, context) {
1875
1552
  case 9: throw _d.sent();
1876
1553
  case 10:
1877
1554
  parsedBody = parsedOutput.body;
1878
- $metadata = deserializeMetadata(output);
1879
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1880
- response = new __BaseException({
1881
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1882
- $fault: "client",
1883
- $metadata: $metadata,
1555
+ throwDefaultError({
1556
+ output: output,
1557
+ parsedBody: parsedBody,
1558
+ exceptionCtor: __BaseException,
1559
+ errorCode: errorCode,
1884
1560
  });
1885
- throw __decorateServiceException(response, parsedBody);
1561
+ _d.label = 11;
1562
+ case 11: return [2];
1886
1563
  }
1887
1564
  });
1888
1565
  }); };
@@ -1894,64 +1571,53 @@ export var deserializeAws_restJson1GetDataSetCommand = function (output, context
1894
1571
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1895
1572
  return [2, deserializeAws_restJson1GetDataSetCommandError(output, context)];
1896
1573
  }
1897
- contents = {
1574
+ contents = map({
1898
1575
  $metadata: deserializeMetadata(output),
1899
- Arn: undefined,
1900
- AssetType: undefined,
1901
- CreatedAt: undefined,
1902
- Description: undefined,
1903
- Id: undefined,
1904
- Name: undefined,
1905
- Origin: undefined,
1906
- OriginDetails: undefined,
1907
- SourceId: undefined,
1908
- Tags: undefined,
1909
- UpdatedAt: undefined,
1910
- };
1576
+ });
1911
1577
  _a = __expectNonNull;
1912
1578
  _b = __expectObject;
1913
1579
  return [4, parseBody(output.body, context)];
1914
1580
  case 1:
1915
1581
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1916
- if (data.Arn !== undefined && data.Arn !== null) {
1582
+ if (data.Arn != null) {
1917
1583
  contents.Arn = __expectString(data.Arn);
1918
1584
  }
1919
- if (data.AssetType !== undefined && data.AssetType !== null) {
1585
+ if (data.AssetType != null) {
1920
1586
  contents.AssetType = __expectString(data.AssetType);
1921
1587
  }
1922
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1588
+ if (data.CreatedAt != null) {
1923
1589
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1924
1590
  }
1925
- if (data.Description !== undefined && data.Description !== null) {
1591
+ if (data.Description != null) {
1926
1592
  contents.Description = __expectString(data.Description);
1927
1593
  }
1928
- if (data.Id !== undefined && data.Id !== null) {
1594
+ if (data.Id != null) {
1929
1595
  contents.Id = __expectString(data.Id);
1930
1596
  }
1931
- if (data.Name !== undefined && data.Name !== null) {
1597
+ if (data.Name != null) {
1932
1598
  contents.Name = __expectString(data.Name);
1933
1599
  }
1934
- if (data.Origin !== undefined && data.Origin !== null) {
1600
+ if (data.Origin != null) {
1935
1601
  contents.Origin = __expectString(data.Origin);
1936
1602
  }
1937
- if (data.OriginDetails !== undefined && data.OriginDetails !== null) {
1603
+ if (data.OriginDetails != null) {
1938
1604
  contents.OriginDetails = deserializeAws_restJson1OriginDetails(data.OriginDetails, context);
1939
1605
  }
1940
- if (data.SourceId !== undefined && data.SourceId !== null) {
1606
+ if (data.SourceId != null) {
1941
1607
  contents.SourceId = __expectString(data.SourceId);
1942
1608
  }
1943
- if (data.Tags !== undefined && data.Tags !== null) {
1609
+ if (data.Tags != null) {
1944
1610
  contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
1945
1611
  }
1946
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1612
+ if (data.UpdatedAt != null) {
1947
1613
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1948
1614
  }
1949
- return [2, Promise.resolve(contents)];
1615
+ return [2, contents];
1950
1616
  }
1951
1617
  });
1952
1618
  }); };
1953
1619
  var deserializeAws_restJson1GetDataSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1954
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1620
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1955
1621
  var _c;
1956
1622
  return __generator(this, function (_d) {
1957
1623
  switch (_d.label) {
@@ -1984,14 +1650,14 @@ var deserializeAws_restJson1GetDataSetCommandError = function (output, context)
1984
1650
  case 9: throw _d.sent();
1985
1651
  case 10:
1986
1652
  parsedBody = parsedOutput.body;
1987
- $metadata = deserializeMetadata(output);
1988
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1989
- response = new __BaseException({
1990
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1991
- $fault: "client",
1992
- $metadata: $metadata,
1653
+ throwDefaultError({
1654
+ output: output,
1655
+ parsedBody: parsedBody,
1656
+ exceptionCtor: __BaseException,
1657
+ errorCode: errorCode,
1993
1658
  });
1994
- throw __decorateServiceException(response, parsedBody);
1659
+ _d.label = 11;
1660
+ case 11: return [2];
1995
1661
  }
1996
1662
  });
1997
1663
  }); };
@@ -2003,44 +1669,38 @@ export var deserializeAws_restJson1GetEventActionCommand = function (output, con
2003
1669
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2004
1670
  return [2, deserializeAws_restJson1GetEventActionCommandError(output, context)];
2005
1671
  }
2006
- contents = {
1672
+ contents = map({
2007
1673
  $metadata: deserializeMetadata(output),
2008
- Action: undefined,
2009
- Arn: undefined,
2010
- CreatedAt: undefined,
2011
- Event: undefined,
2012
- Id: undefined,
2013
- UpdatedAt: undefined,
2014
- };
1674
+ });
2015
1675
  _a = __expectNonNull;
2016
1676
  _b = __expectObject;
2017
1677
  return [4, parseBody(output.body, context)];
2018
1678
  case 1:
2019
1679
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2020
- if (data.Action !== undefined && data.Action !== null) {
1680
+ if (data.Action != null) {
2021
1681
  contents.Action = deserializeAws_restJson1Action(data.Action, context);
2022
1682
  }
2023
- if (data.Arn !== undefined && data.Arn !== null) {
1683
+ if (data.Arn != null) {
2024
1684
  contents.Arn = __expectString(data.Arn);
2025
1685
  }
2026
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1686
+ if (data.CreatedAt != null) {
2027
1687
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2028
1688
  }
2029
- if (data.Event !== undefined && data.Event !== null) {
1689
+ if (data.Event != null) {
2030
1690
  contents.Event = deserializeAws_restJson1Event(data.Event, context);
2031
1691
  }
2032
- if (data.Id !== undefined && data.Id !== null) {
1692
+ if (data.Id != null) {
2033
1693
  contents.Id = __expectString(data.Id);
2034
1694
  }
2035
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1695
+ if (data.UpdatedAt != null) {
2036
1696
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2037
1697
  }
2038
- return [2, Promise.resolve(contents)];
1698
+ return [2, contents];
2039
1699
  }
2040
1700
  });
2041
1701
  }); };
2042
1702
  var deserializeAws_restJson1GetEventActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2043
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1703
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2044
1704
  var _c;
2045
1705
  return __generator(this, function (_d) {
2046
1706
  switch (_d.label) {
@@ -2073,14 +1733,14 @@ var deserializeAws_restJson1GetEventActionCommandError = function (output, conte
2073
1733
  case 9: throw _d.sent();
2074
1734
  case 10:
2075
1735
  parsedBody = parsedOutput.body;
2076
- $metadata = deserializeMetadata(output);
2077
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2078
- response = new __BaseException({
2079
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2080
- $fault: "client",
2081
- $metadata: $metadata,
1736
+ throwDefaultError({
1737
+ output: output,
1738
+ parsedBody: parsedBody,
1739
+ exceptionCtor: __BaseException,
1740
+ errorCode: errorCode,
2082
1741
  });
2083
- throw __decorateServiceException(response, parsedBody);
1742
+ _d.label = 11;
1743
+ case 11: return [2];
2084
1744
  }
2085
1745
  });
2086
1746
  }); };
@@ -2092,52 +1752,44 @@ export var deserializeAws_restJson1GetJobCommand = function (output, context) {
2092
1752
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2093
1753
  return [2, deserializeAws_restJson1GetJobCommandError(output, context)];
2094
1754
  }
2095
- contents = {
1755
+ contents = map({
2096
1756
  $metadata: deserializeMetadata(output),
2097
- Arn: undefined,
2098
- CreatedAt: undefined,
2099
- Details: undefined,
2100
- Errors: undefined,
2101
- Id: undefined,
2102
- State: undefined,
2103
- Type: undefined,
2104
- UpdatedAt: undefined,
2105
- };
1757
+ });
2106
1758
  _a = __expectNonNull;
2107
1759
  _b = __expectObject;
2108
1760
  return [4, parseBody(output.body, context)];
2109
1761
  case 1:
2110
1762
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2111
- if (data.Arn !== undefined && data.Arn !== null) {
1763
+ if (data.Arn != null) {
2112
1764
  contents.Arn = __expectString(data.Arn);
2113
1765
  }
2114
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1766
+ if (data.CreatedAt != null) {
2115
1767
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2116
1768
  }
2117
- if (data.Details !== undefined && data.Details !== null) {
1769
+ if (data.Details != null) {
2118
1770
  contents.Details = deserializeAws_restJson1ResponseDetails(data.Details, context);
2119
1771
  }
2120
- if (data.Errors !== undefined && data.Errors !== null) {
1772
+ if (data.Errors != null) {
2121
1773
  contents.Errors = deserializeAws_restJson1ListOfJobError(data.Errors, context);
2122
1774
  }
2123
- if (data.Id !== undefined && data.Id !== null) {
1775
+ if (data.Id != null) {
2124
1776
  contents.Id = __expectString(data.Id);
2125
1777
  }
2126
- if (data.State !== undefined && data.State !== null) {
1778
+ if (data.State != null) {
2127
1779
  contents.State = __expectString(data.State);
2128
1780
  }
2129
- if (data.Type !== undefined && data.Type !== null) {
1781
+ if (data.Type != null) {
2130
1782
  contents.Type = __expectString(data.Type);
2131
1783
  }
2132
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1784
+ if (data.UpdatedAt != null) {
2133
1785
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2134
1786
  }
2135
- return [2, Promise.resolve(contents)];
1787
+ return [2, contents];
2136
1788
  }
2137
1789
  });
2138
1790
  }); };
2139
1791
  var deserializeAws_restJson1GetJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2140
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1792
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2141
1793
  var _c;
2142
1794
  return __generator(this, function (_d) {
2143
1795
  switch (_d.label) {
@@ -2170,14 +1822,14 @@ var deserializeAws_restJson1GetJobCommandError = function (output, context) { re
2170
1822
  case 9: throw _d.sent();
2171
1823
  case 10:
2172
1824
  parsedBody = parsedOutput.body;
2173
- $metadata = deserializeMetadata(output);
2174
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2175
- response = new __BaseException({
2176
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2177
- $fault: "client",
2178
- $metadata: $metadata,
1825
+ throwDefaultError({
1826
+ output: output,
1827
+ parsedBody: parsedBody,
1828
+ exceptionCtor: __BaseException,
1829
+ errorCode: errorCode,
2179
1830
  });
2180
- throw __decorateServiceException(response, parsedBody);
1831
+ _d.label = 11;
1832
+ case 11: return [2];
2181
1833
  }
2182
1834
  });
2183
1835
  }); };
@@ -2189,68 +1841,56 @@ export var deserializeAws_restJson1GetRevisionCommand = function (output, contex
2189
1841
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2190
1842
  return [2, deserializeAws_restJson1GetRevisionCommandError(output, context)];
2191
1843
  }
2192
- contents = {
1844
+ contents = map({
2193
1845
  $metadata: deserializeMetadata(output),
2194
- Arn: undefined,
2195
- Comment: undefined,
2196
- CreatedAt: undefined,
2197
- DataSetId: undefined,
2198
- Finalized: undefined,
2199
- Id: undefined,
2200
- RevocationComment: undefined,
2201
- Revoked: undefined,
2202
- RevokedAt: undefined,
2203
- SourceId: undefined,
2204
- Tags: undefined,
2205
- UpdatedAt: undefined,
2206
- };
1846
+ });
2207
1847
  _a = __expectNonNull;
2208
1848
  _b = __expectObject;
2209
1849
  return [4, parseBody(output.body, context)];
2210
1850
  case 1:
2211
1851
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2212
- if (data.Arn !== undefined && data.Arn !== null) {
1852
+ if (data.Arn != null) {
2213
1853
  contents.Arn = __expectString(data.Arn);
2214
1854
  }
2215
- if (data.Comment !== undefined && data.Comment !== null) {
1855
+ if (data.Comment != null) {
2216
1856
  contents.Comment = __expectString(data.Comment);
2217
1857
  }
2218
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1858
+ if (data.CreatedAt != null) {
2219
1859
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2220
1860
  }
2221
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
1861
+ if (data.DataSetId != null) {
2222
1862
  contents.DataSetId = __expectString(data.DataSetId);
2223
1863
  }
2224
- if (data.Finalized !== undefined && data.Finalized !== null) {
1864
+ if (data.Finalized != null) {
2225
1865
  contents.Finalized = __expectBoolean(data.Finalized);
2226
1866
  }
2227
- if (data.Id !== undefined && data.Id !== null) {
1867
+ if (data.Id != null) {
2228
1868
  contents.Id = __expectString(data.Id);
2229
1869
  }
2230
- if (data.RevocationComment !== undefined && data.RevocationComment !== null) {
1870
+ if (data.RevocationComment != null) {
2231
1871
  contents.RevocationComment = __expectString(data.RevocationComment);
2232
1872
  }
2233
- if (data.Revoked !== undefined && data.Revoked !== null) {
1873
+ if (data.Revoked != null) {
2234
1874
  contents.Revoked = __expectBoolean(data.Revoked);
2235
1875
  }
2236
- if (data.RevokedAt !== undefined && data.RevokedAt !== null) {
1876
+ if (data.RevokedAt != null) {
2237
1877
  contents.RevokedAt = __expectNonNull(__parseRfc3339DateTime(data.RevokedAt));
2238
1878
  }
2239
- if (data.SourceId !== undefined && data.SourceId !== null) {
1879
+ if (data.SourceId != null) {
2240
1880
  contents.SourceId = __expectString(data.SourceId);
2241
1881
  }
2242
- if (data.Tags !== undefined && data.Tags !== null) {
1882
+ if (data.Tags != null) {
2243
1883
  contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
2244
1884
  }
2245
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1885
+ if (data.UpdatedAt != null) {
2246
1886
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2247
1887
  }
2248
- return [2, Promise.resolve(contents)];
1888
+ return [2, contents];
2249
1889
  }
2250
1890
  });
2251
1891
  }); };
2252
1892
  var deserializeAws_restJson1GetRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2253
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1893
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2254
1894
  var _c;
2255
1895
  return __generator(this, function (_d) {
2256
1896
  switch (_d.label) {
@@ -2283,14 +1923,14 @@ var deserializeAws_restJson1GetRevisionCommandError = function (output, context)
2283
1923
  case 9: throw _d.sent();
2284
1924
  case 10:
2285
1925
  parsedBody = parsedOutput.body;
2286
- $metadata = deserializeMetadata(output);
2287
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2288
- response = new __BaseException({
2289
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2290
- $fault: "client",
2291
- $metadata: $metadata,
1926
+ throwDefaultError({
1927
+ output: output,
1928
+ parsedBody: parsedBody,
1929
+ exceptionCtor: __BaseException,
1930
+ errorCode: errorCode,
2292
1931
  });
2293
- throw __decorateServiceException(response, parsedBody);
1932
+ _d.label = 11;
1933
+ case 11: return [2];
2294
1934
  }
2295
1935
  });
2296
1936
  }); };
@@ -2302,28 +1942,26 @@ export var deserializeAws_restJson1ListDataSetRevisionsCommand = function (outpu
2302
1942
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2303
1943
  return [2, deserializeAws_restJson1ListDataSetRevisionsCommandError(output, context)];
2304
1944
  }
2305
- contents = {
1945
+ contents = map({
2306
1946
  $metadata: deserializeMetadata(output),
2307
- NextToken: undefined,
2308
- Revisions: undefined,
2309
- };
1947
+ });
2310
1948
  _a = __expectNonNull;
2311
1949
  _b = __expectObject;
2312
1950
  return [4, parseBody(output.body, context)];
2313
1951
  case 1:
2314
1952
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2315
- if (data.NextToken !== undefined && data.NextToken !== null) {
1953
+ if (data.NextToken != null) {
2316
1954
  contents.NextToken = __expectString(data.NextToken);
2317
1955
  }
2318
- if (data.Revisions !== undefined && data.Revisions !== null) {
1956
+ if (data.Revisions != null) {
2319
1957
  contents.Revisions = deserializeAws_restJson1ListOfRevisionEntry(data.Revisions, context);
2320
1958
  }
2321
- return [2, Promise.resolve(contents)];
1959
+ return [2, contents];
2322
1960
  }
2323
1961
  });
2324
1962
  }); };
2325
1963
  var deserializeAws_restJson1ListDataSetRevisionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2326
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1964
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2327
1965
  var _c;
2328
1966
  return __generator(this, function (_d) {
2329
1967
  switch (_d.label) {
@@ -2356,14 +1994,14 @@ var deserializeAws_restJson1ListDataSetRevisionsCommandError = function (output,
2356
1994
  case 9: throw _d.sent();
2357
1995
  case 10:
2358
1996
  parsedBody = parsedOutput.body;
2359
- $metadata = deserializeMetadata(output);
2360
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2361
- response = new __BaseException({
2362
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2363
- $fault: "client",
2364
- $metadata: $metadata,
1997
+ throwDefaultError({
1998
+ output: output,
1999
+ parsedBody: parsedBody,
2000
+ exceptionCtor: __BaseException,
2001
+ errorCode: errorCode,
2365
2002
  });
2366
- throw __decorateServiceException(response, parsedBody);
2003
+ _d.label = 11;
2004
+ case 11: return [2];
2367
2005
  }
2368
2006
  });
2369
2007
  }); };
@@ -2375,28 +2013,26 @@ export var deserializeAws_restJson1ListDataSetsCommand = function (output, conte
2375
2013
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2376
2014
  return [2, deserializeAws_restJson1ListDataSetsCommandError(output, context)];
2377
2015
  }
2378
- contents = {
2016
+ contents = map({
2379
2017
  $metadata: deserializeMetadata(output),
2380
- DataSets: undefined,
2381
- NextToken: undefined,
2382
- };
2018
+ });
2383
2019
  _a = __expectNonNull;
2384
2020
  _b = __expectObject;
2385
2021
  return [4, parseBody(output.body, context)];
2386
2022
  case 1:
2387
2023
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2388
- if (data.DataSets !== undefined && data.DataSets !== null) {
2024
+ if (data.DataSets != null) {
2389
2025
  contents.DataSets = deserializeAws_restJson1ListOfDataSetEntry(data.DataSets, context);
2390
2026
  }
2391
- if (data.NextToken !== undefined && data.NextToken !== null) {
2027
+ if (data.NextToken != null) {
2392
2028
  contents.NextToken = __expectString(data.NextToken);
2393
2029
  }
2394
- return [2, Promise.resolve(contents)];
2030
+ return [2, contents];
2395
2031
  }
2396
2032
  });
2397
2033
  }); };
2398
2034
  var deserializeAws_restJson1ListDataSetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2399
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2035
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2400
2036
  var _c;
2401
2037
  return __generator(this, function (_d) {
2402
2038
  switch (_d.label) {
@@ -2429,14 +2065,14 @@ var deserializeAws_restJson1ListDataSetsCommandError = function (output, context
2429
2065
  case 9: throw _d.sent();
2430
2066
  case 10:
2431
2067
  parsedBody = parsedOutput.body;
2432
- $metadata = deserializeMetadata(output);
2433
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2434
- response = new __BaseException({
2435
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2436
- $fault: "client",
2437
- $metadata: $metadata,
2068
+ throwDefaultError({
2069
+ output: output,
2070
+ parsedBody: parsedBody,
2071
+ exceptionCtor: __BaseException,
2072
+ errorCode: errorCode,
2438
2073
  });
2439
- throw __decorateServiceException(response, parsedBody);
2074
+ _d.label = 11;
2075
+ case 11: return [2];
2440
2076
  }
2441
2077
  });
2442
2078
  }); };
@@ -2448,28 +2084,26 @@ export var deserializeAws_restJson1ListEventActionsCommand = function (output, c
2448
2084
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2449
2085
  return [2, deserializeAws_restJson1ListEventActionsCommandError(output, context)];
2450
2086
  }
2451
- contents = {
2087
+ contents = map({
2452
2088
  $metadata: deserializeMetadata(output),
2453
- EventActions: undefined,
2454
- NextToken: undefined,
2455
- };
2089
+ });
2456
2090
  _a = __expectNonNull;
2457
2091
  _b = __expectObject;
2458
2092
  return [4, parseBody(output.body, context)];
2459
2093
  case 1:
2460
2094
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2461
- if (data.EventActions !== undefined && data.EventActions !== null) {
2095
+ if (data.EventActions != null) {
2462
2096
  contents.EventActions = deserializeAws_restJson1ListOfEventActionEntry(data.EventActions, context);
2463
2097
  }
2464
- if (data.NextToken !== undefined && data.NextToken !== null) {
2098
+ if (data.NextToken != null) {
2465
2099
  contents.NextToken = __expectString(data.NextToken);
2466
2100
  }
2467
- return [2, Promise.resolve(contents)];
2101
+ return [2, contents];
2468
2102
  }
2469
2103
  });
2470
2104
  }); };
2471
2105
  var deserializeAws_restJson1ListEventActionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2472
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2106
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2473
2107
  var _c;
2474
2108
  return __generator(this, function (_d) {
2475
2109
  switch (_d.label) {
@@ -2502,14 +2136,14 @@ var deserializeAws_restJson1ListEventActionsCommandError = function (output, con
2502
2136
  case 9: throw _d.sent();
2503
2137
  case 10:
2504
2138
  parsedBody = parsedOutput.body;
2505
- $metadata = deserializeMetadata(output);
2506
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2507
- response = new __BaseException({
2508
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2509
- $fault: "client",
2510
- $metadata: $metadata,
2139
+ throwDefaultError({
2140
+ output: output,
2141
+ parsedBody: parsedBody,
2142
+ exceptionCtor: __BaseException,
2143
+ errorCode: errorCode,
2511
2144
  });
2512
- throw __decorateServiceException(response, parsedBody);
2145
+ _d.label = 11;
2146
+ case 11: return [2];
2513
2147
  }
2514
2148
  });
2515
2149
  }); };
@@ -2521,28 +2155,26 @@ export var deserializeAws_restJson1ListJobsCommand = function (output, context)
2521
2155
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2522
2156
  return [2, deserializeAws_restJson1ListJobsCommandError(output, context)];
2523
2157
  }
2524
- contents = {
2158
+ contents = map({
2525
2159
  $metadata: deserializeMetadata(output),
2526
- Jobs: undefined,
2527
- NextToken: undefined,
2528
- };
2160
+ });
2529
2161
  _a = __expectNonNull;
2530
2162
  _b = __expectObject;
2531
2163
  return [4, parseBody(output.body, context)];
2532
2164
  case 1:
2533
2165
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2534
- if (data.Jobs !== undefined && data.Jobs !== null) {
2166
+ if (data.Jobs != null) {
2535
2167
  contents.Jobs = deserializeAws_restJson1ListOfJobEntry(data.Jobs, context);
2536
2168
  }
2537
- if (data.NextToken !== undefined && data.NextToken !== null) {
2169
+ if (data.NextToken != null) {
2538
2170
  contents.NextToken = __expectString(data.NextToken);
2539
2171
  }
2540
- return [2, Promise.resolve(contents)];
2172
+ return [2, contents];
2541
2173
  }
2542
2174
  });
2543
2175
  }); };
2544
2176
  var deserializeAws_restJson1ListJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2545
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2177
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2546
2178
  var _c;
2547
2179
  return __generator(this, function (_d) {
2548
2180
  switch (_d.label) {
@@ -2575,14 +2207,14 @@ var deserializeAws_restJson1ListJobsCommandError = function (output, context) {
2575
2207
  case 9: throw _d.sent();
2576
2208
  case 10:
2577
2209
  parsedBody = parsedOutput.body;
2578
- $metadata = deserializeMetadata(output);
2579
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2580
- response = new __BaseException({
2581
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2582
- $fault: "client",
2583
- $metadata: $metadata,
2210
+ throwDefaultError({
2211
+ output: output,
2212
+ parsedBody: parsedBody,
2213
+ exceptionCtor: __BaseException,
2214
+ errorCode: errorCode,
2584
2215
  });
2585
- throw __decorateServiceException(response, parsedBody);
2216
+ _d.label = 11;
2217
+ case 11: return [2];
2586
2218
  }
2587
2219
  });
2588
2220
  }); };
@@ -2594,28 +2226,26 @@ export var deserializeAws_restJson1ListRevisionAssetsCommand = function (output,
2594
2226
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2595
2227
  return [2, deserializeAws_restJson1ListRevisionAssetsCommandError(output, context)];
2596
2228
  }
2597
- contents = {
2229
+ contents = map({
2598
2230
  $metadata: deserializeMetadata(output),
2599
- Assets: undefined,
2600
- NextToken: undefined,
2601
- };
2231
+ });
2602
2232
  _a = __expectNonNull;
2603
2233
  _b = __expectObject;
2604
2234
  return [4, parseBody(output.body, context)];
2605
2235
  case 1:
2606
2236
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2607
- if (data.Assets !== undefined && data.Assets !== null) {
2237
+ if (data.Assets != null) {
2608
2238
  contents.Assets = deserializeAws_restJson1ListOfAssetEntry(data.Assets, context);
2609
2239
  }
2610
- if (data.NextToken !== undefined && data.NextToken !== null) {
2240
+ if (data.NextToken != null) {
2611
2241
  contents.NextToken = __expectString(data.NextToken);
2612
2242
  }
2613
- return [2, Promise.resolve(contents)];
2243
+ return [2, contents];
2614
2244
  }
2615
2245
  });
2616
2246
  }); };
2617
2247
  var deserializeAws_restJson1ListRevisionAssetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2618
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2248
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2619
2249
  var _c;
2620
2250
  return __generator(this, function (_d) {
2621
2251
  switch (_d.label) {
@@ -2648,14 +2278,14 @@ var deserializeAws_restJson1ListRevisionAssetsCommandError = function (output, c
2648
2278
  case 9: throw _d.sent();
2649
2279
  case 10:
2650
2280
  parsedBody = parsedOutput.body;
2651
- $metadata = deserializeMetadata(output);
2652
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2653
- response = new __BaseException({
2654
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2655
- $fault: "client",
2656
- $metadata: $metadata,
2281
+ throwDefaultError({
2282
+ output: output,
2283
+ parsedBody: parsedBody,
2284
+ exceptionCtor: __BaseException,
2285
+ errorCode: errorCode,
2657
2286
  });
2658
- throw __decorateServiceException(response, parsedBody);
2287
+ _d.label = 11;
2288
+ case 11: return [2];
2659
2289
  }
2660
2290
  });
2661
2291
  }); };
@@ -2667,24 +2297,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2667
2297
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2668
2298
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2669
2299
  }
2670
- contents = {
2300
+ contents = map({
2671
2301
  $metadata: deserializeMetadata(output),
2672
- Tags: undefined,
2673
- };
2302
+ });
2674
2303
  _a = __expectNonNull;
2675
2304
  _b = __expectObject;
2676
2305
  return [4, parseBody(output.body, context)];
2677
2306
  case 1:
2678
2307
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2679
- if (data.tags !== undefined && data.tags !== null) {
2308
+ if (data.tags != null) {
2680
2309
  contents.Tags = deserializeAws_restJson1MapOf__string(data.tags, context);
2681
2310
  }
2682
- return [2, Promise.resolve(contents)];
2311
+ return [2, contents];
2683
2312
  }
2684
2313
  });
2685
2314
  }); };
2686
2315
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2687
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2316
+ var parsedOutput, _a, errorCode, parsedBody;
2688
2317
  var _b;
2689
2318
  return __generator(this, function (_c) {
2690
2319
  switch (_c.label) {
@@ -2695,18 +2324,13 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2695
2324
  case 1:
2696
2325
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2697
2326
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2698
- switch (errorCode) {
2699
- default:
2700
- parsedBody = parsedOutput.body;
2701
- $metadata = deserializeMetadata(output);
2702
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2703
- response = new __BaseException({
2704
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2705
- $fault: "client",
2706
- $metadata: $metadata,
2707
- });
2708
- throw __decorateServiceException(response, parsedBody);
2709
- }
2327
+ parsedBody = parsedOutput.body;
2328
+ throwDefaultError({
2329
+ output: output,
2330
+ parsedBody: parsedBody,
2331
+ exceptionCtor: __BaseException,
2332
+ errorCode: errorCode,
2333
+ });
2710
2334
  return [2];
2711
2335
  }
2712
2336
  });
@@ -2719,64 +2343,53 @@ export var deserializeAws_restJson1RevokeRevisionCommand = function (output, con
2719
2343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2720
2344
  return [2, deserializeAws_restJson1RevokeRevisionCommandError(output, context)];
2721
2345
  }
2722
- contents = {
2346
+ contents = map({
2723
2347
  $metadata: deserializeMetadata(output),
2724
- Arn: undefined,
2725
- Comment: undefined,
2726
- CreatedAt: undefined,
2727
- DataSetId: undefined,
2728
- Finalized: undefined,
2729
- Id: undefined,
2730
- RevocationComment: undefined,
2731
- Revoked: undefined,
2732
- RevokedAt: undefined,
2733
- SourceId: undefined,
2734
- UpdatedAt: undefined,
2735
- };
2348
+ });
2736
2349
  _a = __expectNonNull;
2737
2350
  _b = __expectObject;
2738
2351
  return [4, parseBody(output.body, context)];
2739
2352
  case 1:
2740
2353
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2741
- if (data.Arn !== undefined && data.Arn !== null) {
2354
+ if (data.Arn != null) {
2742
2355
  contents.Arn = __expectString(data.Arn);
2743
2356
  }
2744
- if (data.Comment !== undefined && data.Comment !== null) {
2357
+ if (data.Comment != null) {
2745
2358
  contents.Comment = __expectString(data.Comment);
2746
2359
  }
2747
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2360
+ if (data.CreatedAt != null) {
2748
2361
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2749
2362
  }
2750
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
2363
+ if (data.DataSetId != null) {
2751
2364
  contents.DataSetId = __expectString(data.DataSetId);
2752
2365
  }
2753
- if (data.Finalized !== undefined && data.Finalized !== null) {
2366
+ if (data.Finalized != null) {
2754
2367
  contents.Finalized = __expectBoolean(data.Finalized);
2755
2368
  }
2756
- if (data.Id !== undefined && data.Id !== null) {
2369
+ if (data.Id != null) {
2757
2370
  contents.Id = __expectString(data.Id);
2758
2371
  }
2759
- if (data.RevocationComment !== undefined && data.RevocationComment !== null) {
2372
+ if (data.RevocationComment != null) {
2760
2373
  contents.RevocationComment = __expectString(data.RevocationComment);
2761
2374
  }
2762
- if (data.Revoked !== undefined && data.Revoked !== null) {
2375
+ if (data.Revoked != null) {
2763
2376
  contents.Revoked = __expectBoolean(data.Revoked);
2764
2377
  }
2765
- if (data.RevokedAt !== undefined && data.RevokedAt !== null) {
2378
+ if (data.RevokedAt != null) {
2766
2379
  contents.RevokedAt = __expectNonNull(__parseRfc3339DateTime(data.RevokedAt));
2767
2380
  }
2768
- if (data.SourceId !== undefined && data.SourceId !== null) {
2381
+ if (data.SourceId != null) {
2769
2382
  contents.SourceId = __expectString(data.SourceId);
2770
2383
  }
2771
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2384
+ if (data.UpdatedAt != null) {
2772
2385
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2773
2386
  }
2774
- return [2, Promise.resolve(contents)];
2387
+ return [2, contents];
2775
2388
  }
2776
2389
  });
2777
2390
  }); };
2778
2391
  var deserializeAws_restJson1RevokeRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2779
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2392
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2780
2393
  var _c;
2781
2394
  return __generator(this, function (_d) {
2782
2395
  switch (_d.label) {
@@ -2817,14 +2430,14 @@ var deserializeAws_restJson1RevokeRevisionCommandError = function (output, conte
2817
2430
  case 13: throw _d.sent();
2818
2431
  case 14:
2819
2432
  parsedBody = parsedOutput.body;
2820
- $metadata = deserializeMetadata(output);
2821
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2822
- response = new __BaseException({
2823
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2824
- $fault: "client",
2825
- $metadata: $metadata,
2433
+ throwDefaultError({
2434
+ output: output,
2435
+ parsedBody: parsedBody,
2436
+ exceptionCtor: __BaseException,
2437
+ errorCode: errorCode,
2826
2438
  });
2827
- throw __decorateServiceException(response, parsedBody);
2439
+ _d.label = 15;
2440
+ case 15: return [2];
2828
2441
  }
2829
2442
  });
2830
2443
  }); };
@@ -2836,29 +2449,28 @@ export var deserializeAws_restJson1SendApiAssetCommand = function (output, conte
2836
2449
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2837
2450
  return [2, deserializeAws_restJson1SendApiAssetCommandError(output, context)];
2838
2451
  }
2839
- contents = {
2452
+ contents = map({
2840
2453
  $metadata: deserializeMetadata(output),
2841
- Body: undefined,
2842
- ResponseHeaders: undefined,
2843
- };
2844
- Object.keys(output.headers).forEach(function (header) {
2845
- if (contents.ResponseHeaders === undefined) {
2846
- contents.ResponseHeaders = {};
2847
- }
2848
- if (header.startsWith("")) {
2849
- contents.ResponseHeaders[header.substring(0)] = output.headers[header];
2850
- }
2454
+ ResponseHeaders: [
2455
+ ,
2456
+ Object.keys(output.headers)
2457
+ .filter(function (header) { return header.startsWith(""); })
2458
+ .reduce(function (acc, header) {
2459
+ acc[header.substring(0)] = output.headers[header];
2460
+ return acc;
2461
+ }, {}),
2462
+ ],
2851
2463
  });
2852
2464
  return [4, collectBodyString(output.body, context)];
2853
2465
  case 1:
2854
2466
  data = _a.sent();
2855
2467
  contents.Body = __expectString(data);
2856
- return [2, Promise.resolve(contents)];
2468
+ return [2, contents];
2857
2469
  }
2858
2470
  });
2859
2471
  }); };
2860
2472
  var deserializeAws_restJson1SendApiAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2861
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2473
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2862
2474
  var _c;
2863
2475
  return __generator(this, function (_d) {
2864
2476
  switch (_d.label) {
@@ -2895,14 +2507,14 @@ var deserializeAws_restJson1SendApiAssetCommandError = function (output, context
2895
2507
  case 11: throw _d.sent();
2896
2508
  case 12:
2897
2509
  parsedBody = parsedOutput.body;
2898
- $metadata = deserializeMetadata(output);
2899
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2900
- response = new __BaseException({
2901
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2902
- $fault: "client",
2903
- $metadata: $metadata,
2510
+ throwDefaultError({
2511
+ output: output,
2512
+ parsedBody: parsedBody,
2513
+ exceptionCtor: __BaseException,
2514
+ errorCode: errorCode,
2904
2515
  });
2905
- throw __decorateServiceException(response, parsedBody);
2516
+ _d.label = 13;
2517
+ case 13: return [2];
2906
2518
  }
2907
2519
  });
2908
2520
  }); };
@@ -2914,18 +2526,18 @@ export var deserializeAws_restJson1StartJobCommand = function (output, context)
2914
2526
  if (output.statusCode !== 202 && output.statusCode >= 300) {
2915
2527
  return [2, deserializeAws_restJson1StartJobCommandError(output, context)];
2916
2528
  }
2917
- contents = {
2529
+ contents = map({
2918
2530
  $metadata: deserializeMetadata(output),
2919
- };
2531
+ });
2920
2532
  return [4, collectBody(output.body, context)];
2921
2533
  case 1:
2922
2534
  _a.sent();
2923
- return [2, Promise.resolve(contents)];
2535
+ return [2, contents];
2924
2536
  }
2925
2537
  });
2926
2538
  }); };
2927
2539
  var deserializeAws_restJson1StartJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2928
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2540
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2929
2541
  var _c;
2930
2542
  return __generator(this, function (_d) {
2931
2543
  switch (_d.label) {
@@ -2966,14 +2578,14 @@ var deserializeAws_restJson1StartJobCommandError = function (output, context) {
2966
2578
  case 13: throw _d.sent();
2967
2579
  case 14:
2968
2580
  parsedBody = parsedOutput.body;
2969
- $metadata = deserializeMetadata(output);
2970
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2971
- response = new __BaseException({
2972
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2973
- $fault: "client",
2974
- $metadata: $metadata,
2581
+ throwDefaultError({
2582
+ output: output,
2583
+ parsedBody: parsedBody,
2584
+ exceptionCtor: __BaseException,
2585
+ errorCode: errorCode,
2975
2586
  });
2976
- throw __decorateServiceException(response, parsedBody);
2587
+ _d.label = 15;
2588
+ case 15: return [2];
2977
2589
  }
2978
2590
  });
2979
2591
  }); };
@@ -2985,18 +2597,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2985
2597
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2986
2598
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2987
2599
  }
2988
- contents = {
2600
+ contents = map({
2989
2601
  $metadata: deserializeMetadata(output),
2990
- };
2602
+ });
2991
2603
  return [4, collectBody(output.body, context)];
2992
2604
  case 1:
2993
2605
  _a.sent();
2994
- return [2, Promise.resolve(contents)];
2606
+ return [2, contents];
2995
2607
  }
2996
2608
  });
2997
2609
  }); };
2998
2610
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2999
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2611
+ var parsedOutput, _a, errorCode, parsedBody;
3000
2612
  var _b;
3001
2613
  return __generator(this, function (_c) {
3002
2614
  switch (_c.label) {
@@ -3007,18 +2619,13 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
3007
2619
  case 1:
3008
2620
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3009
2621
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3010
- switch (errorCode) {
3011
- default:
3012
- parsedBody = parsedOutput.body;
3013
- $metadata = deserializeMetadata(output);
3014
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3015
- response = new __BaseException({
3016
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3017
- $fault: "client",
3018
- $metadata: $metadata,
3019
- });
3020
- throw __decorateServiceException(response, parsedBody);
3021
- }
2622
+ parsedBody = parsedOutput.body;
2623
+ throwDefaultError({
2624
+ output: output,
2625
+ parsedBody: parsedBody,
2626
+ exceptionCtor: __BaseException,
2627
+ errorCode: errorCode,
2628
+ });
3022
2629
  return [2];
3023
2630
  }
3024
2631
  });
@@ -3031,18 +2638,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
3031
2638
  if (output.statusCode !== 204 && output.statusCode >= 300) {
3032
2639
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
3033
2640
  }
3034
- contents = {
2641
+ contents = map({
3035
2642
  $metadata: deserializeMetadata(output),
3036
- };
2643
+ });
3037
2644
  return [4, collectBody(output.body, context)];
3038
2645
  case 1:
3039
2646
  _a.sent();
3040
- return [2, Promise.resolve(contents)];
2647
+ return [2, contents];
3041
2648
  }
3042
2649
  });
3043
2650
  }); };
3044
2651
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3045
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2652
+ var parsedOutput, _a, errorCode, parsedBody;
3046
2653
  var _b;
3047
2654
  return __generator(this, function (_c) {
3048
2655
  switch (_c.label) {
@@ -3053,18 +2660,13 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
3053
2660
  case 1:
3054
2661
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3055
2662
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3056
- switch (errorCode) {
3057
- default:
3058
- parsedBody = parsedOutput.body;
3059
- $metadata = deserializeMetadata(output);
3060
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3061
- response = new __BaseException({
3062
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3063
- $fault: "client",
3064
- $metadata: $metadata,
3065
- });
3066
- throw __decorateServiceException(response, parsedBody);
3067
- }
2663
+ parsedBody = parsedOutput.body;
2664
+ throwDefaultError({
2665
+ output: output,
2666
+ parsedBody: parsedBody,
2667
+ exceptionCtor: __BaseException,
2668
+ errorCode: errorCode,
2669
+ });
3068
2670
  return [2];
3069
2671
  }
3070
2672
  });
@@ -3077,60 +2679,50 @@ export var deserializeAws_restJson1UpdateAssetCommand = function (output, contex
3077
2679
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3078
2680
  return [2, deserializeAws_restJson1UpdateAssetCommandError(output, context)];
3079
2681
  }
3080
- contents = {
2682
+ contents = map({
3081
2683
  $metadata: deserializeMetadata(output),
3082
- Arn: undefined,
3083
- AssetDetails: undefined,
3084
- AssetType: undefined,
3085
- CreatedAt: undefined,
3086
- DataSetId: undefined,
3087
- Id: undefined,
3088
- Name: undefined,
3089
- RevisionId: undefined,
3090
- SourceId: undefined,
3091
- UpdatedAt: undefined,
3092
- };
2684
+ });
3093
2685
  _a = __expectNonNull;
3094
2686
  _b = __expectObject;
3095
2687
  return [4, parseBody(output.body, context)];
3096
2688
  case 1:
3097
2689
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3098
- if (data.Arn !== undefined && data.Arn !== null) {
2690
+ if (data.Arn != null) {
3099
2691
  contents.Arn = __expectString(data.Arn);
3100
2692
  }
3101
- if (data.AssetDetails !== undefined && data.AssetDetails !== null) {
2693
+ if (data.AssetDetails != null) {
3102
2694
  contents.AssetDetails = deserializeAws_restJson1AssetDetails(data.AssetDetails, context);
3103
2695
  }
3104
- if (data.AssetType !== undefined && data.AssetType !== null) {
2696
+ if (data.AssetType != null) {
3105
2697
  contents.AssetType = __expectString(data.AssetType);
3106
2698
  }
3107
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2699
+ if (data.CreatedAt != null) {
3108
2700
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
3109
2701
  }
3110
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
2702
+ if (data.DataSetId != null) {
3111
2703
  contents.DataSetId = __expectString(data.DataSetId);
3112
2704
  }
3113
- if (data.Id !== undefined && data.Id !== null) {
2705
+ if (data.Id != null) {
3114
2706
  contents.Id = __expectString(data.Id);
3115
2707
  }
3116
- if (data.Name !== undefined && data.Name !== null) {
2708
+ if (data.Name != null) {
3117
2709
  contents.Name = __expectString(data.Name);
3118
2710
  }
3119
- if (data.RevisionId !== undefined && data.RevisionId !== null) {
2711
+ if (data.RevisionId != null) {
3120
2712
  contents.RevisionId = __expectString(data.RevisionId);
3121
2713
  }
3122
- if (data.SourceId !== undefined && data.SourceId !== null) {
2714
+ if (data.SourceId != null) {
3123
2715
  contents.SourceId = __expectString(data.SourceId);
3124
2716
  }
3125
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2717
+ if (data.UpdatedAt != null) {
3126
2718
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
3127
2719
  }
3128
- return [2, Promise.resolve(contents)];
2720
+ return [2, contents];
3129
2721
  }
3130
2722
  });
3131
2723
  }); };
3132
2724
  var deserializeAws_restJson1UpdateAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3133
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2725
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3134
2726
  var _c;
3135
2727
  return __generator(this, function (_d) {
3136
2728
  switch (_d.label) {
@@ -3171,14 +2763,14 @@ var deserializeAws_restJson1UpdateAssetCommandError = function (output, context)
3171
2763
  case 13: throw _d.sent();
3172
2764
  case 14:
3173
2765
  parsedBody = parsedOutput.body;
3174
- $metadata = deserializeMetadata(output);
3175
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3176
- response = new __BaseException({
3177
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3178
- $fault: "client",
3179
- $metadata: $metadata,
2766
+ throwDefaultError({
2767
+ output: output,
2768
+ parsedBody: parsedBody,
2769
+ exceptionCtor: __BaseException,
2770
+ errorCode: errorCode,
3180
2771
  });
3181
- throw __decorateServiceException(response, parsedBody);
2772
+ _d.label = 15;
2773
+ case 15: return [2];
3182
2774
  }
3183
2775
  });
3184
2776
  }); };
@@ -3190,60 +2782,50 @@ export var deserializeAws_restJson1UpdateDataSetCommand = function (output, cont
3190
2782
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3191
2783
  return [2, deserializeAws_restJson1UpdateDataSetCommandError(output, context)];
3192
2784
  }
3193
- contents = {
2785
+ contents = map({
3194
2786
  $metadata: deserializeMetadata(output),
3195
- Arn: undefined,
3196
- AssetType: undefined,
3197
- CreatedAt: undefined,
3198
- Description: undefined,
3199
- Id: undefined,
3200
- Name: undefined,
3201
- Origin: undefined,
3202
- OriginDetails: undefined,
3203
- SourceId: undefined,
3204
- UpdatedAt: undefined,
3205
- };
2787
+ });
3206
2788
  _a = __expectNonNull;
3207
2789
  _b = __expectObject;
3208
2790
  return [4, parseBody(output.body, context)];
3209
2791
  case 1:
3210
2792
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3211
- if (data.Arn !== undefined && data.Arn !== null) {
2793
+ if (data.Arn != null) {
3212
2794
  contents.Arn = __expectString(data.Arn);
3213
2795
  }
3214
- if (data.AssetType !== undefined && data.AssetType !== null) {
2796
+ if (data.AssetType != null) {
3215
2797
  contents.AssetType = __expectString(data.AssetType);
3216
2798
  }
3217
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2799
+ if (data.CreatedAt != null) {
3218
2800
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
3219
2801
  }
3220
- if (data.Description !== undefined && data.Description !== null) {
2802
+ if (data.Description != null) {
3221
2803
  contents.Description = __expectString(data.Description);
3222
2804
  }
3223
- if (data.Id !== undefined && data.Id !== null) {
2805
+ if (data.Id != null) {
3224
2806
  contents.Id = __expectString(data.Id);
3225
2807
  }
3226
- if (data.Name !== undefined && data.Name !== null) {
2808
+ if (data.Name != null) {
3227
2809
  contents.Name = __expectString(data.Name);
3228
2810
  }
3229
- if (data.Origin !== undefined && data.Origin !== null) {
2811
+ if (data.Origin != null) {
3230
2812
  contents.Origin = __expectString(data.Origin);
3231
2813
  }
3232
- if (data.OriginDetails !== undefined && data.OriginDetails !== null) {
2814
+ if (data.OriginDetails != null) {
3233
2815
  contents.OriginDetails = deserializeAws_restJson1OriginDetails(data.OriginDetails, context);
3234
2816
  }
3235
- if (data.SourceId !== undefined && data.SourceId !== null) {
2817
+ if (data.SourceId != null) {
3236
2818
  contents.SourceId = __expectString(data.SourceId);
3237
2819
  }
3238
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2820
+ if (data.UpdatedAt != null) {
3239
2821
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
3240
2822
  }
3241
- return [2, Promise.resolve(contents)];
2823
+ return [2, contents];
3242
2824
  }
3243
2825
  });
3244
2826
  }); };
3245
2827
  var deserializeAws_restJson1UpdateDataSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3246
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2828
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3247
2829
  var _c;
3248
2830
  return __generator(this, function (_d) {
3249
2831
  switch (_d.label) {
@@ -3280,14 +2862,14 @@ var deserializeAws_restJson1UpdateDataSetCommandError = function (output, contex
3280
2862
  case 11: throw _d.sent();
3281
2863
  case 12:
3282
2864
  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,
2865
+ throwDefaultError({
2866
+ output: output,
2867
+ parsedBody: parsedBody,
2868
+ exceptionCtor: __BaseException,
2869
+ errorCode: errorCode,
3289
2870
  });
3290
- throw __decorateServiceException(response, parsedBody);
2871
+ _d.label = 13;
2872
+ case 13: return [2];
3291
2873
  }
3292
2874
  });
3293
2875
  }); };
@@ -3299,44 +2881,38 @@ export var deserializeAws_restJson1UpdateEventActionCommand = function (output,
3299
2881
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3300
2882
  return [2, deserializeAws_restJson1UpdateEventActionCommandError(output, context)];
3301
2883
  }
3302
- contents = {
2884
+ contents = map({
3303
2885
  $metadata: deserializeMetadata(output),
3304
- Action: undefined,
3305
- Arn: undefined,
3306
- CreatedAt: undefined,
3307
- Event: undefined,
3308
- Id: undefined,
3309
- UpdatedAt: undefined,
3310
- };
2886
+ });
3311
2887
  _a = __expectNonNull;
3312
2888
  _b = __expectObject;
3313
2889
  return [4, parseBody(output.body, context)];
3314
2890
  case 1:
3315
2891
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3316
- if (data.Action !== undefined && data.Action !== null) {
2892
+ if (data.Action != null) {
3317
2893
  contents.Action = deserializeAws_restJson1Action(data.Action, context);
3318
2894
  }
3319
- if (data.Arn !== undefined && data.Arn !== null) {
2895
+ if (data.Arn != null) {
3320
2896
  contents.Arn = __expectString(data.Arn);
3321
2897
  }
3322
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2898
+ if (data.CreatedAt != null) {
3323
2899
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
3324
2900
  }
3325
- if (data.Event !== undefined && data.Event !== null) {
2901
+ if (data.Event != null) {
3326
2902
  contents.Event = deserializeAws_restJson1Event(data.Event, context);
3327
2903
  }
3328
- if (data.Id !== undefined && data.Id !== null) {
2904
+ if (data.Id != null) {
3329
2905
  contents.Id = __expectString(data.Id);
3330
2906
  }
3331
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2907
+ if (data.UpdatedAt != null) {
3332
2908
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
3333
2909
  }
3334
- return [2, Promise.resolve(contents)];
2910
+ return [2, contents];
3335
2911
  }
3336
2912
  });
3337
2913
  }); };
3338
2914
  var deserializeAws_restJson1UpdateEventActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3339
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2915
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3340
2916
  var _c;
3341
2917
  return __generator(this, function (_d) {
3342
2918
  switch (_d.label) {
@@ -3373,14 +2949,14 @@ var deserializeAws_restJson1UpdateEventActionCommandError = function (output, co
3373
2949
  case 11: throw _d.sent();
3374
2950
  case 12:
3375
2951
  parsedBody = parsedOutput.body;
3376
- $metadata = deserializeMetadata(output);
3377
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3378
- response = new __BaseException({
3379
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3380
- $fault: "client",
3381
- $metadata: $metadata,
2952
+ throwDefaultError({
2953
+ output: output,
2954
+ parsedBody: parsedBody,
2955
+ exceptionCtor: __BaseException,
2956
+ errorCode: errorCode,
3382
2957
  });
3383
- throw __decorateServiceException(response, parsedBody);
2958
+ _d.label = 13;
2959
+ case 13: return [2];
3384
2960
  }
3385
2961
  });
3386
2962
  }); };
@@ -3392,64 +2968,53 @@ export var deserializeAws_restJson1UpdateRevisionCommand = function (output, con
3392
2968
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3393
2969
  return [2, deserializeAws_restJson1UpdateRevisionCommandError(output, context)];
3394
2970
  }
3395
- contents = {
2971
+ contents = map({
3396
2972
  $metadata: deserializeMetadata(output),
3397
- Arn: undefined,
3398
- Comment: undefined,
3399
- CreatedAt: undefined,
3400
- DataSetId: undefined,
3401
- Finalized: undefined,
3402
- Id: undefined,
3403
- RevocationComment: undefined,
3404
- Revoked: undefined,
3405
- RevokedAt: undefined,
3406
- SourceId: undefined,
3407
- UpdatedAt: undefined,
3408
- };
2973
+ });
3409
2974
  _a = __expectNonNull;
3410
2975
  _b = __expectObject;
3411
2976
  return [4, parseBody(output.body, context)];
3412
2977
  case 1:
3413
2978
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3414
- if (data.Arn !== undefined && data.Arn !== null) {
2979
+ if (data.Arn != null) {
3415
2980
  contents.Arn = __expectString(data.Arn);
3416
2981
  }
3417
- if (data.Comment !== undefined && data.Comment !== null) {
2982
+ if (data.Comment != null) {
3418
2983
  contents.Comment = __expectString(data.Comment);
3419
2984
  }
3420
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2985
+ if (data.CreatedAt != null) {
3421
2986
  contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
3422
2987
  }
3423
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
2988
+ if (data.DataSetId != null) {
3424
2989
  contents.DataSetId = __expectString(data.DataSetId);
3425
2990
  }
3426
- if (data.Finalized !== undefined && data.Finalized !== null) {
2991
+ if (data.Finalized != null) {
3427
2992
  contents.Finalized = __expectBoolean(data.Finalized);
3428
2993
  }
3429
- if (data.Id !== undefined && data.Id !== null) {
2994
+ if (data.Id != null) {
3430
2995
  contents.Id = __expectString(data.Id);
3431
2996
  }
3432
- if (data.RevocationComment !== undefined && data.RevocationComment !== null) {
2997
+ if (data.RevocationComment != null) {
3433
2998
  contents.RevocationComment = __expectString(data.RevocationComment);
3434
2999
  }
3435
- if (data.Revoked !== undefined && data.Revoked !== null) {
3000
+ if (data.Revoked != null) {
3436
3001
  contents.Revoked = __expectBoolean(data.Revoked);
3437
3002
  }
3438
- if (data.RevokedAt !== undefined && data.RevokedAt !== null) {
3003
+ if (data.RevokedAt != null) {
3439
3004
  contents.RevokedAt = __expectNonNull(__parseRfc3339DateTime(data.RevokedAt));
3440
3005
  }
3441
- if (data.SourceId !== undefined && data.SourceId !== null) {
3006
+ if (data.SourceId != null) {
3442
3007
  contents.SourceId = __expectString(data.SourceId);
3443
3008
  }
3444
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
3009
+ if (data.UpdatedAt != null) {
3445
3010
  contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
3446
3011
  }
3447
- return [2, Promise.resolve(contents)];
3012
+ return [2, contents];
3448
3013
  }
3449
3014
  });
3450
3015
  }); };
3451
3016
  var deserializeAws_restJson1UpdateRevisionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3452
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3017
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3453
3018
  var _c;
3454
3019
  return __generator(this, function (_d) {
3455
3020
  switch (_d.label) {
@@ -3490,23 +3055,24 @@ var deserializeAws_restJson1UpdateRevisionCommandError = function (output, conte
3490
3055
  case 13: throw _d.sent();
3491
3056
  case 14:
3492
3057
  parsedBody = parsedOutput.body;
3493
- $metadata = deserializeMetadata(output);
3494
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3495
- response = new __BaseException({
3496
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3497
- $fault: "client",
3498
- $metadata: $metadata,
3058
+ throwDefaultError({
3059
+ output: output,
3060
+ parsedBody: parsedBody,
3061
+ exceptionCtor: __BaseException,
3062
+ errorCode: errorCode,
3499
3063
  });
3500
- throw __decorateServiceException(response, parsedBody);
3064
+ _d.label = 15;
3065
+ case 15: return [2];
3501
3066
  }
3502
3067
  });
3503
3068
  }); };
3069
+ var map = __map;
3504
3070
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3505
3071
  var contents, data, exception;
3506
3072
  return __generator(this, function (_a) {
3507
- contents = {};
3073
+ contents = map({});
3508
3074
  data = parsedOutput.body;
3509
- if (data.Message !== undefined && data.Message !== null) {
3075
+ if (data.Message != null) {
3510
3076
  contents.Message = __expectString(data.Message);
3511
3077
  }
3512
3078
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3516,15 +3082,15 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
3516
3082
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3517
3083
  var contents, data, exception;
3518
3084
  return __generator(this, function (_a) {
3519
- contents = {};
3085
+ contents = map({});
3520
3086
  data = parsedOutput.body;
3521
- if (data.Message !== undefined && data.Message !== null) {
3087
+ if (data.Message != null) {
3522
3088
  contents.Message = __expectString(data.Message);
3523
3089
  }
3524
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
3090
+ if (data.ResourceId != null) {
3525
3091
  contents.ResourceId = __expectString(data.ResourceId);
3526
3092
  }
3527
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
3093
+ if (data.ResourceType != null) {
3528
3094
  contents.ResourceType = __expectString(data.ResourceType);
3529
3095
  }
3530
3096
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3534,9 +3100,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
3534
3100
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3535
3101
  var contents, data, exception;
3536
3102
  return __generator(this, function (_a) {
3537
- contents = {};
3103
+ contents = map({});
3538
3104
  data = parsedOutput.body;
3539
- if (data.Message !== undefined && data.Message !== null) {
3105
+ if (data.Message != null) {
3540
3106
  contents.Message = __expectString(data.Message);
3541
3107
  }
3542
3108
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3546,15 +3112,15 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
3546
3112
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3547
3113
  var contents, data, exception;
3548
3114
  return __generator(this, function (_a) {
3549
- contents = {};
3115
+ contents = map({});
3550
3116
  data = parsedOutput.body;
3551
- if (data.Message !== undefined && data.Message !== null) {
3117
+ if (data.Message != null) {
3552
3118
  contents.Message = __expectString(data.Message);
3553
3119
  }
3554
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
3120
+ if (data.ResourceId != null) {
3555
3121
  contents.ResourceId = __expectString(data.ResourceId);
3556
3122
  }
3557
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
3123
+ if (data.ResourceType != null) {
3558
3124
  contents.ResourceType = __expectString(data.ResourceType);
3559
3125
  }
3560
3126
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3564,15 +3130,15 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
3564
3130
  var deserializeAws_restJson1ServiceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3565
3131
  var contents, data, exception;
3566
3132
  return __generator(this, function (_a) {
3567
- contents = {};
3133
+ contents = map({});
3568
3134
  data = parsedOutput.body;
3569
- if (data.LimitName !== undefined && data.LimitName !== null) {
3135
+ if (data.LimitName != null) {
3570
3136
  contents.LimitName = __expectString(data.LimitName);
3571
3137
  }
3572
- if (data.LimitValue !== undefined && data.LimitValue !== null) {
3138
+ if (data.LimitValue != null) {
3573
3139
  contents.LimitValue = __limitedParseDouble(data.LimitValue);
3574
3140
  }
3575
- if (data.Message !== undefined && data.Message !== null) {
3141
+ if (data.Message != null) {
3576
3142
  contents.Message = __expectString(data.Message);
3577
3143
  }
3578
3144
  exception = new ServiceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3582,9 +3148,9 @@ var deserializeAws_restJson1ServiceLimitExceededExceptionResponse = function (pa
3582
3148
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3583
3149
  var contents, data, exception;
3584
3150
  return __generator(this, function (_a) {
3585
- contents = {};
3151
+ contents = map({});
3586
3152
  data = parsedOutput.body;
3587
- if (data.Message !== undefined && data.Message !== null) {
3153
+ if (data.Message != null) {
3588
3154
  contents.Message = __expectString(data.Message);
3589
3155
  }
3590
3156
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3594,12 +3160,12 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
3594
3160
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3595
3161
  var contents, data, exception;
3596
3162
  return __generator(this, function (_a) {
3597
- contents = {};
3163
+ contents = map({});
3598
3164
  data = parsedOutput.body;
3599
- if (data.ExceptionCause !== undefined && data.ExceptionCause !== null) {
3165
+ if (data.ExceptionCause != null) {
3600
3166
  contents.ExceptionCause = __expectString(data.ExceptionCause);
3601
3167
  }
3602
- if (data.Message !== undefined && data.Message !== null) {
3168
+ if (data.Message != null) {
3603
3169
  contents.Message = __expectString(data.Message);
3604
3170
  }
3605
3171
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3672,9 +3238,6 @@ var serializeAws_restJson1ListOfAssetDestinationEntry = function (input, context
3672
3238
  return input
3673
3239
  .filter(function (e) { return e != null; })
3674
3240
  .map(function (entry) {
3675
- if (entry === null) {
3676
- return null;
3677
- }
3678
3241
  return serializeAws_restJson1AssetDestinationEntry(entry, context);
3679
3242
  });
3680
3243
  };
@@ -3682,9 +3245,6 @@ var serializeAws_restJson1ListOfAssetSourceEntry = function (input, context) {
3682
3245
  return input
3683
3246
  .filter(function (e) { return e != null; })
3684
3247
  .map(function (entry) {
3685
- if (entry === null) {
3686
- return null;
3687
- }
3688
3248
  return serializeAws_restJson1AssetSourceEntry(entry, context);
3689
3249
  });
3690
3250
  };
@@ -3692,9 +3252,6 @@ var serializeAws_restJson1ListOfRedshiftDataShareAssetSourceEntry = function (in
3692
3252
  return input
3693
3253
  .filter(function (e) { return e != null; })
3694
3254
  .map(function (entry) {
3695
- if (entry === null) {
3696
- return null;
3697
- }
3698
3255
  return serializeAws_restJson1RedshiftDataShareAssetSourceEntry(entry, context);
3699
3256
  });
3700
3257
  };
@@ -3702,9 +3259,6 @@ var serializeAws_restJson1ListOfRevisionDestinationEntry = function (input, cont
3702
3259
  return input
3703
3260
  .filter(function (e) { return e != null; })
3704
3261
  .map(function (entry) {
3705
- if (entry === null) {
3706
- return null;
3707
- }
3708
3262
  return serializeAws_restJson1RevisionDestinationEntry(entry, context);
3709
3263
  });
3710
3264
  };