@aws-sdk/client-mediapackage 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { MediaPackageServiceException as __BaseException } from "../models/MediaPackageServiceException";
5
5
  import { ForbiddenException, InternalServerErrorException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, UnprocessableEntityException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1ConfigureLogsCommand = 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()];
@@ -14,16 +14,7 @@ export var serializeAws_restJson1ConfigureLogsCommand = function (input, context
14
14
  "content-type": "application/json",
15
15
  };
16
16
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels/{Id}/configure_logs";
17
- if (input.Id !== undefined) {
18
- labelValue = input.Id;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: Id.");
21
- }
22
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: Id.");
26
- }
17
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
27
18
  body = JSON.stringify(__assign(__assign({}, (input.EgressAccessLogs != null && {
28
19
  egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context),
29
20
  })), (input.IngressAccessLogs != null && {
@@ -120,7 +111,7 @@ export var serializeAws_restJson1CreateOriginEndpointCommand = function (input,
120
111
  });
121
112
  }); };
122
113
  export var serializeAws_restJson1DeleteChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
123
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
114
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
124
115
  return __generator(this, function (_c) {
125
116
  switch (_c.label) {
126
117
  case 0: return [4, context.endpoint()];
@@ -128,16 +119,7 @@ export var serializeAws_restJson1DeleteChannelCommand = function (input, context
128
119
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
129
120
  headers = {};
130
121
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels/{Id}";
131
- if (input.Id !== undefined) {
132
- labelValue = input.Id;
133
- if (labelValue.length <= 0) {
134
- throw new Error("Empty value provided for input HTTP label: Id.");
135
- }
136
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
137
- }
138
- else {
139
- throw new Error("No value provided for input HTTP label: Id.");
140
- }
122
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
141
123
  return [2, new __HttpRequest({
142
124
  protocol: protocol,
143
125
  hostname: hostname,
@@ -151,7 +133,7 @@ export var serializeAws_restJson1DeleteChannelCommand = function (input, context
151
133
  });
152
134
  }); };
153
135
  export var serializeAws_restJson1DeleteOriginEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
154
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
136
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
155
137
  return __generator(this, function (_c) {
156
138
  switch (_c.label) {
157
139
  case 0: return [4, context.endpoint()];
@@ -159,16 +141,7 @@ export var serializeAws_restJson1DeleteOriginEndpointCommand = function (input,
159
141
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
160
142
  headers = {};
161
143
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/origin_endpoints/{Id}";
162
- if (input.Id !== undefined) {
163
- labelValue = input.Id;
164
- if (labelValue.length <= 0) {
165
- throw new Error("Empty value provided for input HTTP label: Id.");
166
- }
167
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
168
- }
169
- else {
170
- throw new Error("No value provided for input HTTP label: Id.");
171
- }
144
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
172
145
  return [2, new __HttpRequest({
173
146
  protocol: protocol,
174
147
  hostname: hostname,
@@ -182,7 +155,7 @@ export var serializeAws_restJson1DeleteOriginEndpointCommand = function (input,
182
155
  });
183
156
  }); };
184
157
  export var serializeAws_restJson1DescribeChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
185
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
158
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
186
159
  return __generator(this, function (_c) {
187
160
  switch (_c.label) {
188
161
  case 0: return [4, context.endpoint()];
@@ -190,16 +163,7 @@ export var serializeAws_restJson1DescribeChannelCommand = function (input, conte
190
163
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
191
164
  headers = {};
192
165
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels/{Id}";
193
- if (input.Id !== undefined) {
194
- labelValue = input.Id;
195
- if (labelValue.length <= 0) {
196
- throw new Error("Empty value provided for input HTTP label: Id.");
197
- }
198
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
199
- }
200
- else {
201
- throw new Error("No value provided for input HTTP label: Id.");
202
- }
166
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
203
167
  return [2, new __HttpRequest({
204
168
  protocol: protocol,
205
169
  hostname: hostname,
@@ -213,7 +177,7 @@ export var serializeAws_restJson1DescribeChannelCommand = function (input, conte
213
177
  });
214
178
  }); };
215
179
  export var serializeAws_restJson1DescribeHarvestJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
216
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
180
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
217
181
  return __generator(this, function (_c) {
218
182
  switch (_c.label) {
219
183
  case 0: return [4, context.endpoint()];
@@ -221,16 +185,7 @@ export var serializeAws_restJson1DescribeHarvestJobCommand = function (input, co
221
185
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
222
186
  headers = {};
223
187
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/harvest_jobs/{Id}";
224
- if (input.Id !== undefined) {
225
- labelValue = input.Id;
226
- if (labelValue.length <= 0) {
227
- throw new Error("Empty value provided for input HTTP label: Id.");
228
- }
229
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
230
- }
231
- else {
232
- throw new Error("No value provided for input HTTP label: Id.");
233
- }
188
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
234
189
  return [2, new __HttpRequest({
235
190
  protocol: protocol,
236
191
  hostname: hostname,
@@ -244,7 +199,7 @@ export var serializeAws_restJson1DescribeHarvestJobCommand = function (input, co
244
199
  });
245
200
  }); };
246
201
  export var serializeAws_restJson1DescribeOriginEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
247
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
202
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
248
203
  return __generator(this, function (_c) {
249
204
  switch (_c.label) {
250
205
  case 0: return [4, context.endpoint()];
@@ -252,16 +207,7 @@ export var serializeAws_restJson1DescribeOriginEndpointCommand = function (input
252
207
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
253
208
  headers = {};
254
209
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/origin_endpoints/{Id}";
255
- if (input.Id !== undefined) {
256
- labelValue = input.Id;
257
- if (labelValue.length <= 0) {
258
- throw new Error("Empty value provided for input HTTP label: Id.");
259
- }
260
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
261
- }
262
- else {
263
- throw new Error("No value provided for input HTTP label: Id.");
264
- }
210
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
265
211
  return [2, new __HttpRequest({
266
212
  protocol: protocol,
267
213
  hostname: hostname,
@@ -283,7 +229,10 @@ export var serializeAws_restJson1ListChannelsCommand = function (input, context)
283
229
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
284
230
  headers = {};
285
231
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels";
286
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
232
+ query = map({
233
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
234
+ nextToken: [, input.NextToken],
235
+ });
287
236
  return [2, new __HttpRequest({
288
237
  protocol: protocol,
289
238
  hostname: hostname,
@@ -306,7 +255,12 @@ export var serializeAws_restJson1ListHarvestJobsCommand = function (input, conte
306
255
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
307
256
  headers = {};
308
257
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/harvest_jobs";
309
- query = __assign(__assign(__assign(__assign({}, (input.IncludeChannelId !== undefined && { includeChannelId: input.IncludeChannelId })), (input.IncludeStatus !== undefined && { includeStatus: input.IncludeStatus })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
258
+ query = map({
259
+ includeChannelId: [, input.IncludeChannelId],
260
+ includeStatus: [, input.IncludeStatus],
261
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
262
+ nextToken: [, input.NextToken],
263
+ });
310
264
  return [2, new __HttpRequest({
311
265
  protocol: protocol,
312
266
  hostname: hostname,
@@ -329,7 +283,11 @@ export var serializeAws_restJson1ListOriginEndpointsCommand = function (input, c
329
283
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
330
284
  headers = {};
331
285
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/origin_endpoints";
332
- query = __assign(__assign(__assign({}, (input.ChannelId !== undefined && { channelId: input.ChannelId })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
286
+ query = map({
287
+ channelId: [, input.ChannelId],
288
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
289
+ nextToken: [, input.NextToken],
290
+ });
333
291
  return [2, new __HttpRequest({
334
292
  protocol: protocol,
335
293
  hostname: hostname,
@@ -344,7 +302,7 @@ export var serializeAws_restJson1ListOriginEndpointsCommand = function (input, c
344
302
  });
345
303
  }); };
346
304
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
347
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
305
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
348
306
  return __generator(this, function (_c) {
349
307
  switch (_c.label) {
350
308
  case 0: return [4, context.endpoint()];
@@ -352,16 +310,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
352
310
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
353
311
  headers = {};
354
312
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
355
- if (input.ResourceArn !== undefined) {
356
- labelValue = input.ResourceArn;
357
- if (labelValue.length <= 0) {
358
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
359
- }
360
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
361
- }
362
- else {
363
- throw new Error("No value provided for input HTTP label: ResourceArn.");
364
- }
313
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
365
314
  return [2, new __HttpRequest({
366
315
  protocol: protocol,
367
316
  hostname: hostname,
@@ -375,7 +324,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
375
324
  });
376
325
  }); };
377
326
  export var serializeAws_restJson1RotateChannelCredentialsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
378
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
327
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
379
328
  return __generator(this, function (_c) {
380
329
  switch (_c.label) {
381
330
  case 0: return [4, context.endpoint()];
@@ -383,16 +332,7 @@ export var serializeAws_restJson1RotateChannelCredentialsCommand = function (inp
383
332
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
384
333
  headers = {};
385
334
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels/{Id}/credentials";
386
- if (input.Id !== undefined) {
387
- labelValue = input.Id;
388
- if (labelValue.length <= 0) {
389
- throw new Error("Empty value provided for input HTTP label: Id.");
390
- }
391
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
392
- }
393
- else {
394
- throw new Error("No value provided for input HTTP label: Id.");
395
- }
335
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
396
336
  return [2, new __HttpRequest({
397
337
  protocol: protocol,
398
338
  hostname: hostname,
@@ -406,7 +346,7 @@ export var serializeAws_restJson1RotateChannelCredentialsCommand = function (inp
406
346
  });
407
347
  }); };
408
348
  export var serializeAws_restJson1RotateIngestEndpointCredentialsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
409
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
349
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
410
350
  return __generator(this, function (_c) {
411
351
  switch (_c.label) {
412
352
  case 0: return [4, context.endpoint()];
@@ -415,26 +355,8 @@ export var serializeAws_restJson1RotateIngestEndpointCredentialsCommand = functi
415
355
  headers = {};
416
356
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
417
357
  "/channels/{Id}/ingest_endpoints/{IngestEndpointId}/credentials";
418
- if (input.Id !== undefined) {
419
- labelValue = input.Id;
420
- if (labelValue.length <= 0) {
421
- throw new Error("Empty value provided for input HTTP label: Id.");
422
- }
423
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
424
- }
425
- else {
426
- throw new Error("No value provided for input HTTP label: Id.");
427
- }
428
- if (input.IngestEndpointId !== undefined) {
429
- labelValue = input.IngestEndpointId;
430
- if (labelValue.length <= 0) {
431
- throw new Error("Empty value provided for input HTTP label: IngestEndpointId.");
432
- }
433
- resolvedPath = resolvedPath.replace("{IngestEndpointId}", __extendedEncodeURIComponent(labelValue));
434
- }
435
- else {
436
- throw new Error("No value provided for input HTTP label: IngestEndpointId.");
437
- }
358
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
359
+ resolvedPath = __resolvedPath(resolvedPath, input, "IngestEndpointId", function () { return input.IngestEndpointId; }, "{IngestEndpointId}", false);
438
360
  return [2, new __HttpRequest({
439
361
  protocol: protocol,
440
362
  hostname: hostname,
@@ -448,7 +370,7 @@ export var serializeAws_restJson1RotateIngestEndpointCredentialsCommand = functi
448
370
  });
449
371
  }); };
450
372
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
451
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
373
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
452
374
  return __generator(this, function (_c) {
453
375
  switch (_c.label) {
454
376
  case 0: return [4, context.endpoint()];
@@ -458,16 +380,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
458
380
  "content-type": "application/json",
459
381
  };
460
382
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
461
- if (input.ResourceArn !== undefined) {
462
- labelValue = input.ResourceArn;
463
- if (labelValue.length <= 0) {
464
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
465
- }
466
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
467
- }
468
- else {
469
- throw new Error("No value provided for input HTTP label: ResourceArn.");
470
- }
383
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
471
384
  body = JSON.stringify(__assign({}, (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
472
385
  return [2, new __HttpRequest({
473
386
  protocol: protocol,
@@ -482,7 +395,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
482
395
  });
483
396
  }); };
484
397
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
485
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
398
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
486
399
  return __generator(this, function (_c) {
487
400
  switch (_c.label) {
488
401
  case 0: return [4, context.endpoint()];
@@ -490,17 +403,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
490
403
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
491
404
  headers = {};
492
405
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
493
- if (input.ResourceArn !== undefined) {
494
- labelValue = input.ResourceArn;
495
- if (labelValue.length <= 0) {
496
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
497
- }
498
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
499
- }
500
- else {
501
- throw new Error("No value provided for input HTTP label: ResourceArn.");
502
- }
503
- query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
406
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
407
+ query = map({
408
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
409
+ });
504
410
  return [2, new __HttpRequest({
505
411
  protocol: protocol,
506
412
  hostname: hostname,
@@ -515,7 +421,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
515
421
  });
516
422
  }); };
517
423
  export var serializeAws_restJson1UpdateChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
518
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
424
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
519
425
  return __generator(this, function (_c) {
520
426
  switch (_c.label) {
521
427
  case 0: return [4, context.endpoint()];
@@ -525,16 +431,7 @@ export var serializeAws_restJson1UpdateChannelCommand = function (input, context
525
431
  "content-type": "application/json",
526
432
  };
527
433
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels/{Id}";
528
- if (input.Id !== undefined) {
529
- labelValue = input.Id;
530
- if (labelValue.length <= 0) {
531
- throw new Error("Empty value provided for input HTTP label: Id.");
532
- }
533
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
534
- }
535
- else {
536
- throw new Error("No value provided for input HTTP label: Id.");
537
- }
434
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
538
435
  body = JSON.stringify(__assign({}, (input.Description != null && { description: input.Description })));
539
436
  return [2, new __HttpRequest({
540
437
  protocol: protocol,
@@ -549,7 +446,7 @@ export var serializeAws_restJson1UpdateChannelCommand = function (input, context
549
446
  });
550
447
  }); };
551
448
  export var serializeAws_restJson1UpdateOriginEndpointCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
552
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
449
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
553
450
  return __generator(this, function (_c) {
554
451
  switch (_c.label) {
555
452
  case 0: return [4, context.endpoint()];
@@ -559,16 +456,7 @@ export var serializeAws_restJson1UpdateOriginEndpointCommand = function (input,
559
456
  "content-type": "application/json",
560
457
  };
561
458
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/origin_endpoints/{Id}";
562
- if (input.Id !== undefined) {
563
- labelValue = input.Id;
564
- if (labelValue.length <= 0) {
565
- throw new Error("Empty value provided for input HTTP label: Id.");
566
- }
567
- resolvedPath = resolvedPath.replace("{Id}", __extendedEncodeURIComponent(labelValue));
568
- }
569
- else {
570
- throw new Error("No value provided for input HTTP label: Id.");
571
- }
459
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
572
460
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Authorization != null && {
573
461
  authorization: serializeAws_restJson1Authorization(input.Authorization, context),
574
462
  })), (input.CmafPackage != null && {
@@ -594,48 +482,41 @@ export var deserializeAws_restJson1ConfigureLogsCommand = function (output, cont
594
482
  if (output.statusCode !== 200 && output.statusCode >= 300) {
595
483
  return [2, deserializeAws_restJson1ConfigureLogsCommandError(output, context)];
596
484
  }
597
- contents = {
485
+ contents = map({
598
486
  $metadata: deserializeMetadata(output),
599
- Arn: undefined,
600
- Description: undefined,
601
- EgressAccessLogs: undefined,
602
- HlsIngest: undefined,
603
- Id: undefined,
604
- IngressAccessLogs: undefined,
605
- Tags: undefined,
606
- };
487
+ });
607
488
  _a = __expectNonNull;
608
489
  _b = __expectObject;
609
490
  return [4, parseBody(output.body, context)];
610
491
  case 1:
611
492
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
612
- if (data.arn !== undefined && data.arn !== null) {
493
+ if (data.arn != null) {
613
494
  contents.Arn = __expectString(data.arn);
614
495
  }
615
- if (data.description !== undefined && data.description !== null) {
496
+ if (data.description != null) {
616
497
  contents.Description = __expectString(data.description);
617
498
  }
618
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
499
+ if (data.egressAccessLogs != null) {
619
500
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
620
501
  }
621
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
502
+ if (data.hlsIngest != null) {
622
503
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
623
504
  }
624
- if (data.id !== undefined && data.id !== null) {
505
+ if (data.id != null) {
625
506
  contents.Id = __expectString(data.id);
626
507
  }
627
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
508
+ if (data.ingressAccessLogs != null) {
628
509
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
629
510
  }
630
- if (data.tags !== undefined && data.tags !== null) {
511
+ if (data.tags != null) {
631
512
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
632
513
  }
633
- return [2, Promise.resolve(contents)];
514
+ return [2, contents];
634
515
  }
635
516
  });
636
517
  }); };
637
518
  var deserializeAws_restJson1ConfigureLogsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
638
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
519
+ var parsedOutput, _a, errorCode, _b, parsedBody;
639
520
  var _c;
640
521
  return __generator(this, function (_d) {
641
522
  switch (_d.label) {
@@ -676,14 +557,14 @@ var deserializeAws_restJson1ConfigureLogsCommandError = function (output, contex
676
557
  case 13: throw _d.sent();
677
558
  case 14:
678
559
  parsedBody = parsedOutput.body;
679
- $metadata = deserializeMetadata(output);
680
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
681
- response = new __BaseException({
682
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
683
- $fault: "client",
684
- $metadata: $metadata,
560
+ throwDefaultError({
561
+ output: output,
562
+ parsedBody: parsedBody,
563
+ exceptionCtor: __BaseException,
564
+ errorCode: errorCode,
685
565
  });
686
- throw __decorateServiceException(response, parsedBody);
566
+ _d.label = 15;
567
+ case 15: return [2];
687
568
  }
688
569
  });
689
570
  }); };
@@ -695,48 +576,41 @@ export var deserializeAws_restJson1CreateChannelCommand = function (output, cont
695
576
  if (output.statusCode !== 200 && output.statusCode >= 300) {
696
577
  return [2, deserializeAws_restJson1CreateChannelCommandError(output, context)];
697
578
  }
698
- contents = {
579
+ contents = map({
699
580
  $metadata: deserializeMetadata(output),
700
- Arn: undefined,
701
- Description: undefined,
702
- EgressAccessLogs: undefined,
703
- HlsIngest: undefined,
704
- Id: undefined,
705
- IngressAccessLogs: undefined,
706
- Tags: undefined,
707
- };
581
+ });
708
582
  _a = __expectNonNull;
709
583
  _b = __expectObject;
710
584
  return [4, parseBody(output.body, context)];
711
585
  case 1:
712
586
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
713
- if (data.arn !== undefined && data.arn !== null) {
587
+ if (data.arn != null) {
714
588
  contents.Arn = __expectString(data.arn);
715
589
  }
716
- if (data.description !== undefined && data.description !== null) {
590
+ if (data.description != null) {
717
591
  contents.Description = __expectString(data.description);
718
592
  }
719
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
593
+ if (data.egressAccessLogs != null) {
720
594
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
721
595
  }
722
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
596
+ if (data.hlsIngest != null) {
723
597
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
724
598
  }
725
- if (data.id !== undefined && data.id !== null) {
599
+ if (data.id != null) {
726
600
  contents.Id = __expectString(data.id);
727
601
  }
728
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
602
+ if (data.ingressAccessLogs != null) {
729
603
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
730
604
  }
731
- if (data.tags !== undefined && data.tags !== null) {
605
+ if (data.tags != null) {
732
606
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
733
607
  }
734
- return [2, Promise.resolve(contents)];
608
+ return [2, contents];
735
609
  }
736
610
  });
737
611
  }); };
738
612
  var deserializeAws_restJson1CreateChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
739
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
613
+ var parsedOutput, _a, errorCode, _b, parsedBody;
740
614
  var _c;
741
615
  return __generator(this, function (_d) {
742
616
  switch (_d.label) {
@@ -777,14 +651,14 @@ var deserializeAws_restJson1CreateChannelCommandError = function (output, contex
777
651
  case 13: throw _d.sent();
778
652
  case 14:
779
653
  parsedBody = parsedOutput.body;
780
- $metadata = deserializeMetadata(output);
781
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
782
- response = new __BaseException({
783
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
784
- $fault: "client",
785
- $metadata: $metadata,
654
+ throwDefaultError({
655
+ output: output,
656
+ parsedBody: parsedBody,
657
+ exceptionCtor: __BaseException,
658
+ errorCode: errorCode,
786
659
  });
787
- throw __decorateServiceException(response, parsedBody);
660
+ _d.label = 15;
661
+ case 15: return [2];
788
662
  }
789
663
  });
790
664
  }); };
@@ -796,56 +670,47 @@ export var deserializeAws_restJson1CreateHarvestJobCommand = function (output, c
796
670
  if (output.statusCode !== 200 && output.statusCode >= 300) {
797
671
  return [2, deserializeAws_restJson1CreateHarvestJobCommandError(output, context)];
798
672
  }
799
- contents = {
673
+ contents = map({
800
674
  $metadata: deserializeMetadata(output),
801
- Arn: undefined,
802
- ChannelId: undefined,
803
- CreatedAt: undefined,
804
- EndTime: undefined,
805
- Id: undefined,
806
- OriginEndpointId: undefined,
807
- S3Destination: undefined,
808
- StartTime: undefined,
809
- Status: undefined,
810
- };
675
+ });
811
676
  _a = __expectNonNull;
812
677
  _b = __expectObject;
813
678
  return [4, parseBody(output.body, context)];
814
679
  case 1:
815
680
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
816
- if (data.arn !== undefined && data.arn !== null) {
681
+ if (data.arn != null) {
817
682
  contents.Arn = __expectString(data.arn);
818
683
  }
819
- if (data.channelId !== undefined && data.channelId !== null) {
684
+ if (data.channelId != null) {
820
685
  contents.ChannelId = __expectString(data.channelId);
821
686
  }
822
- if (data.createdAt !== undefined && data.createdAt !== null) {
687
+ if (data.createdAt != null) {
823
688
  contents.CreatedAt = __expectString(data.createdAt);
824
689
  }
825
- if (data.endTime !== undefined && data.endTime !== null) {
690
+ if (data.endTime != null) {
826
691
  contents.EndTime = __expectString(data.endTime);
827
692
  }
828
- if (data.id !== undefined && data.id !== null) {
693
+ if (data.id != null) {
829
694
  contents.Id = __expectString(data.id);
830
695
  }
831
- if (data.originEndpointId !== undefined && data.originEndpointId !== null) {
696
+ if (data.originEndpointId != null) {
832
697
  contents.OriginEndpointId = __expectString(data.originEndpointId);
833
698
  }
834
- if (data.s3Destination !== undefined && data.s3Destination !== null) {
699
+ if (data.s3Destination != null) {
835
700
  contents.S3Destination = deserializeAws_restJson1S3Destination(data.s3Destination, context);
836
701
  }
837
- if (data.startTime !== undefined && data.startTime !== null) {
702
+ if (data.startTime != null) {
838
703
  contents.StartTime = __expectString(data.startTime);
839
704
  }
840
- if (data.status !== undefined && data.status !== null) {
705
+ if (data.status != null) {
841
706
  contents.Status = __expectString(data.status);
842
707
  }
843
- return [2, Promise.resolve(contents)];
708
+ return [2, contents];
844
709
  }
845
710
  });
846
711
  }); };
847
712
  var deserializeAws_restJson1CreateHarvestJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
848
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
713
+ var parsedOutput, _a, errorCode, _b, parsedBody;
849
714
  var _c;
850
715
  return __generator(this, function (_d) {
851
716
  switch (_d.label) {
@@ -886,14 +751,14 @@ var deserializeAws_restJson1CreateHarvestJobCommandError = function (output, con
886
751
  case 13: throw _d.sent();
887
752
  case 14:
888
753
  parsedBody = parsedOutput.body;
889
- $metadata = deserializeMetadata(output);
890
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
891
- response = new __BaseException({
892
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
893
- $fault: "client",
894
- $metadata: $metadata,
754
+ throwDefaultError({
755
+ output: output,
756
+ parsedBody: parsedBody,
757
+ exceptionCtor: __BaseException,
758
+ errorCode: errorCode,
895
759
  });
896
- throw __decorateServiceException(response, parsedBody);
760
+ _d.label = 15;
761
+ case 15: return [2];
897
762
  }
898
763
  });
899
764
  }); };
@@ -905,84 +770,68 @@ export var deserializeAws_restJson1CreateOriginEndpointCommand = function (outpu
905
770
  if (output.statusCode !== 200 && output.statusCode >= 300) {
906
771
  return [2, deserializeAws_restJson1CreateOriginEndpointCommandError(output, context)];
907
772
  }
908
- contents = {
773
+ contents = map({
909
774
  $metadata: deserializeMetadata(output),
910
- Arn: undefined,
911
- Authorization: undefined,
912
- ChannelId: undefined,
913
- CmafPackage: undefined,
914
- DashPackage: undefined,
915
- Description: undefined,
916
- HlsPackage: undefined,
917
- Id: undefined,
918
- ManifestName: undefined,
919
- MssPackage: undefined,
920
- Origination: undefined,
921
- StartoverWindowSeconds: undefined,
922
- Tags: undefined,
923
- TimeDelaySeconds: undefined,
924
- Url: undefined,
925
- Whitelist: undefined,
926
- };
775
+ });
927
776
  _a = __expectNonNull;
928
777
  _b = __expectObject;
929
778
  return [4, parseBody(output.body, context)];
930
779
  case 1:
931
780
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
932
- if (data.arn !== undefined && data.arn !== null) {
781
+ if (data.arn != null) {
933
782
  contents.Arn = __expectString(data.arn);
934
783
  }
935
- if (data.authorization !== undefined && data.authorization !== null) {
784
+ if (data.authorization != null) {
936
785
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
937
786
  }
938
- if (data.channelId !== undefined && data.channelId !== null) {
787
+ if (data.channelId != null) {
939
788
  contents.ChannelId = __expectString(data.channelId);
940
789
  }
941
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
790
+ if (data.cmafPackage != null) {
942
791
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
943
792
  }
944
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
793
+ if (data.dashPackage != null) {
945
794
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
946
795
  }
947
- if (data.description !== undefined && data.description !== null) {
796
+ if (data.description != null) {
948
797
  contents.Description = __expectString(data.description);
949
798
  }
950
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
799
+ if (data.hlsPackage != null) {
951
800
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
952
801
  }
953
- if (data.id !== undefined && data.id !== null) {
802
+ if (data.id != null) {
954
803
  contents.Id = __expectString(data.id);
955
804
  }
956
- if (data.manifestName !== undefined && data.manifestName !== null) {
805
+ if (data.manifestName != null) {
957
806
  contents.ManifestName = __expectString(data.manifestName);
958
807
  }
959
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
808
+ if (data.mssPackage != null) {
960
809
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
961
810
  }
962
- if (data.origination !== undefined && data.origination !== null) {
811
+ if (data.origination != null) {
963
812
  contents.Origination = __expectString(data.origination);
964
813
  }
965
- if (data.startoverWindowSeconds !== undefined && data.startoverWindowSeconds !== null) {
814
+ if (data.startoverWindowSeconds != null) {
966
815
  contents.StartoverWindowSeconds = __expectInt32(data.startoverWindowSeconds);
967
816
  }
968
- if (data.tags !== undefined && data.tags !== null) {
817
+ if (data.tags != null) {
969
818
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
970
819
  }
971
- if (data.timeDelaySeconds !== undefined && data.timeDelaySeconds !== null) {
820
+ if (data.timeDelaySeconds != null) {
972
821
  contents.TimeDelaySeconds = __expectInt32(data.timeDelaySeconds);
973
822
  }
974
- if (data.url !== undefined && data.url !== null) {
823
+ if (data.url != null) {
975
824
  contents.Url = __expectString(data.url);
976
825
  }
977
- if (data.whitelist !== undefined && data.whitelist !== null) {
826
+ if (data.whitelist != null) {
978
827
  contents.Whitelist = deserializeAws_restJson1__listOf__string(data.whitelist, context);
979
828
  }
980
- return [2, Promise.resolve(contents)];
829
+ return [2, contents];
981
830
  }
982
831
  });
983
832
  }); };
984
833
  var deserializeAws_restJson1CreateOriginEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
985
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
834
+ var parsedOutput, _a, errorCode, _b, parsedBody;
986
835
  var _c;
987
836
  return __generator(this, function (_d) {
988
837
  switch (_d.label) {
@@ -1023,14 +872,14 @@ var deserializeAws_restJson1CreateOriginEndpointCommandError = function (output,
1023
872
  case 13: throw _d.sent();
1024
873
  case 14:
1025
874
  parsedBody = parsedOutput.body;
1026
- $metadata = deserializeMetadata(output);
1027
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1028
- response = new __BaseException({
1029
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1030
- $fault: "client",
1031
- $metadata: $metadata,
875
+ throwDefaultError({
876
+ output: output,
877
+ parsedBody: parsedBody,
878
+ exceptionCtor: __BaseException,
879
+ errorCode: errorCode,
1032
880
  });
1033
- throw __decorateServiceException(response, parsedBody);
881
+ _d.label = 15;
882
+ case 15: return [2];
1034
883
  }
1035
884
  });
1036
885
  }); };
@@ -1042,18 +891,18 @@ export var deserializeAws_restJson1DeleteChannelCommand = function (output, cont
1042
891
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1043
892
  return [2, deserializeAws_restJson1DeleteChannelCommandError(output, context)];
1044
893
  }
1045
- contents = {
894
+ contents = map({
1046
895
  $metadata: deserializeMetadata(output),
1047
- };
896
+ });
1048
897
  return [4, collectBody(output.body, context)];
1049
898
  case 1:
1050
899
  _a.sent();
1051
- return [2, Promise.resolve(contents)];
900
+ return [2, contents];
1052
901
  }
1053
902
  });
1054
903
  }); };
1055
904
  var deserializeAws_restJson1DeleteChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1056
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
905
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1057
906
  var _c;
1058
907
  return __generator(this, function (_d) {
1059
908
  switch (_d.label) {
@@ -1094,14 +943,14 @@ var deserializeAws_restJson1DeleteChannelCommandError = function (output, contex
1094
943
  case 13: throw _d.sent();
1095
944
  case 14:
1096
945
  parsedBody = parsedOutput.body;
1097
- $metadata = deserializeMetadata(output);
1098
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1099
- response = new __BaseException({
1100
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1101
- $fault: "client",
1102
- $metadata: $metadata,
946
+ throwDefaultError({
947
+ output: output,
948
+ parsedBody: parsedBody,
949
+ exceptionCtor: __BaseException,
950
+ errorCode: errorCode,
1103
951
  });
1104
- throw __decorateServiceException(response, parsedBody);
952
+ _d.label = 15;
953
+ case 15: return [2];
1105
954
  }
1106
955
  });
1107
956
  }); };
@@ -1113,18 +962,18 @@ export var deserializeAws_restJson1DeleteOriginEndpointCommand = function (outpu
1113
962
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1114
963
  return [2, deserializeAws_restJson1DeleteOriginEndpointCommandError(output, context)];
1115
964
  }
1116
- contents = {
965
+ contents = map({
1117
966
  $metadata: deserializeMetadata(output),
1118
- };
967
+ });
1119
968
  return [4, collectBody(output.body, context)];
1120
969
  case 1:
1121
970
  _a.sent();
1122
- return [2, Promise.resolve(contents)];
971
+ return [2, contents];
1123
972
  }
1124
973
  });
1125
974
  }); };
1126
975
  var deserializeAws_restJson1DeleteOriginEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1127
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
976
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1128
977
  var _c;
1129
978
  return __generator(this, function (_d) {
1130
979
  switch (_d.label) {
@@ -1165,14 +1014,14 @@ var deserializeAws_restJson1DeleteOriginEndpointCommandError = function (output,
1165
1014
  case 13: throw _d.sent();
1166
1015
  case 14:
1167
1016
  parsedBody = parsedOutput.body;
1168
- $metadata = deserializeMetadata(output);
1169
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1170
- response = new __BaseException({
1171
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1172
- $fault: "client",
1173
- $metadata: $metadata,
1017
+ throwDefaultError({
1018
+ output: output,
1019
+ parsedBody: parsedBody,
1020
+ exceptionCtor: __BaseException,
1021
+ errorCode: errorCode,
1174
1022
  });
1175
- throw __decorateServiceException(response, parsedBody);
1023
+ _d.label = 15;
1024
+ case 15: return [2];
1176
1025
  }
1177
1026
  });
1178
1027
  }); };
@@ -1184,48 +1033,41 @@ export var deserializeAws_restJson1DescribeChannelCommand = function (output, co
1184
1033
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1185
1034
  return [2, deserializeAws_restJson1DescribeChannelCommandError(output, context)];
1186
1035
  }
1187
- contents = {
1036
+ contents = map({
1188
1037
  $metadata: deserializeMetadata(output),
1189
- Arn: undefined,
1190
- Description: undefined,
1191
- EgressAccessLogs: undefined,
1192
- HlsIngest: undefined,
1193
- Id: undefined,
1194
- IngressAccessLogs: undefined,
1195
- Tags: undefined,
1196
- };
1038
+ });
1197
1039
  _a = __expectNonNull;
1198
1040
  _b = __expectObject;
1199
1041
  return [4, parseBody(output.body, context)];
1200
1042
  case 1:
1201
1043
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1202
- if (data.arn !== undefined && data.arn !== null) {
1044
+ if (data.arn != null) {
1203
1045
  contents.Arn = __expectString(data.arn);
1204
1046
  }
1205
- if (data.description !== undefined && data.description !== null) {
1047
+ if (data.description != null) {
1206
1048
  contents.Description = __expectString(data.description);
1207
1049
  }
1208
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1050
+ if (data.egressAccessLogs != null) {
1209
1051
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1210
1052
  }
1211
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1053
+ if (data.hlsIngest != null) {
1212
1054
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1213
1055
  }
1214
- if (data.id !== undefined && data.id !== null) {
1056
+ if (data.id != null) {
1215
1057
  contents.Id = __expectString(data.id);
1216
1058
  }
1217
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1059
+ if (data.ingressAccessLogs != null) {
1218
1060
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1219
1061
  }
1220
- if (data.tags !== undefined && data.tags !== null) {
1062
+ if (data.tags != null) {
1221
1063
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1222
1064
  }
1223
- return [2, Promise.resolve(contents)];
1065
+ return [2, contents];
1224
1066
  }
1225
1067
  });
1226
1068
  }); };
1227
1069
  var deserializeAws_restJson1DescribeChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1228
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1070
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1229
1071
  var _c;
1230
1072
  return __generator(this, function (_d) {
1231
1073
  switch (_d.label) {
@@ -1266,14 +1108,14 @@ var deserializeAws_restJson1DescribeChannelCommandError = function (output, cont
1266
1108
  case 13: throw _d.sent();
1267
1109
  case 14:
1268
1110
  parsedBody = parsedOutput.body;
1269
- $metadata = deserializeMetadata(output);
1270
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1271
- response = new __BaseException({
1272
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1273
- $fault: "client",
1274
- $metadata: $metadata,
1111
+ throwDefaultError({
1112
+ output: output,
1113
+ parsedBody: parsedBody,
1114
+ exceptionCtor: __BaseException,
1115
+ errorCode: errorCode,
1275
1116
  });
1276
- throw __decorateServiceException(response, parsedBody);
1117
+ _d.label = 15;
1118
+ case 15: return [2];
1277
1119
  }
1278
1120
  });
1279
1121
  }); };
@@ -1285,56 +1127,47 @@ export var deserializeAws_restJson1DescribeHarvestJobCommand = function (output,
1285
1127
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1286
1128
  return [2, deserializeAws_restJson1DescribeHarvestJobCommandError(output, context)];
1287
1129
  }
1288
- contents = {
1130
+ contents = map({
1289
1131
  $metadata: deserializeMetadata(output),
1290
- Arn: undefined,
1291
- ChannelId: undefined,
1292
- CreatedAt: undefined,
1293
- EndTime: undefined,
1294
- Id: undefined,
1295
- OriginEndpointId: undefined,
1296
- S3Destination: undefined,
1297
- StartTime: undefined,
1298
- Status: undefined,
1299
- };
1132
+ });
1300
1133
  _a = __expectNonNull;
1301
1134
  _b = __expectObject;
1302
1135
  return [4, parseBody(output.body, context)];
1303
1136
  case 1:
1304
1137
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1305
- if (data.arn !== undefined && data.arn !== null) {
1138
+ if (data.arn != null) {
1306
1139
  contents.Arn = __expectString(data.arn);
1307
1140
  }
1308
- if (data.channelId !== undefined && data.channelId !== null) {
1141
+ if (data.channelId != null) {
1309
1142
  contents.ChannelId = __expectString(data.channelId);
1310
1143
  }
1311
- if (data.createdAt !== undefined && data.createdAt !== null) {
1144
+ if (data.createdAt != null) {
1312
1145
  contents.CreatedAt = __expectString(data.createdAt);
1313
1146
  }
1314
- if (data.endTime !== undefined && data.endTime !== null) {
1147
+ if (data.endTime != null) {
1315
1148
  contents.EndTime = __expectString(data.endTime);
1316
1149
  }
1317
- if (data.id !== undefined && data.id !== null) {
1150
+ if (data.id != null) {
1318
1151
  contents.Id = __expectString(data.id);
1319
1152
  }
1320
- if (data.originEndpointId !== undefined && data.originEndpointId !== null) {
1153
+ if (data.originEndpointId != null) {
1321
1154
  contents.OriginEndpointId = __expectString(data.originEndpointId);
1322
1155
  }
1323
- if (data.s3Destination !== undefined && data.s3Destination !== null) {
1156
+ if (data.s3Destination != null) {
1324
1157
  contents.S3Destination = deserializeAws_restJson1S3Destination(data.s3Destination, context);
1325
1158
  }
1326
- if (data.startTime !== undefined && data.startTime !== null) {
1159
+ if (data.startTime != null) {
1327
1160
  contents.StartTime = __expectString(data.startTime);
1328
1161
  }
1329
- if (data.status !== undefined && data.status !== null) {
1162
+ if (data.status != null) {
1330
1163
  contents.Status = __expectString(data.status);
1331
1164
  }
1332
- return [2, Promise.resolve(contents)];
1165
+ return [2, contents];
1333
1166
  }
1334
1167
  });
1335
1168
  }); };
1336
1169
  var deserializeAws_restJson1DescribeHarvestJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1337
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1170
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1338
1171
  var _c;
1339
1172
  return __generator(this, function (_d) {
1340
1173
  switch (_d.label) {
@@ -1375,14 +1208,14 @@ var deserializeAws_restJson1DescribeHarvestJobCommandError = function (output, c
1375
1208
  case 13: throw _d.sent();
1376
1209
  case 14:
1377
1210
  parsedBody = parsedOutput.body;
1378
- $metadata = deserializeMetadata(output);
1379
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1380
- response = new __BaseException({
1381
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1382
- $fault: "client",
1383
- $metadata: $metadata,
1211
+ throwDefaultError({
1212
+ output: output,
1213
+ parsedBody: parsedBody,
1214
+ exceptionCtor: __BaseException,
1215
+ errorCode: errorCode,
1384
1216
  });
1385
- throw __decorateServiceException(response, parsedBody);
1217
+ _d.label = 15;
1218
+ case 15: return [2];
1386
1219
  }
1387
1220
  });
1388
1221
  }); };
@@ -1394,84 +1227,68 @@ export var deserializeAws_restJson1DescribeOriginEndpointCommand = function (out
1394
1227
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1395
1228
  return [2, deserializeAws_restJson1DescribeOriginEndpointCommandError(output, context)];
1396
1229
  }
1397
- contents = {
1230
+ contents = map({
1398
1231
  $metadata: deserializeMetadata(output),
1399
- Arn: undefined,
1400
- Authorization: undefined,
1401
- ChannelId: undefined,
1402
- CmafPackage: undefined,
1403
- DashPackage: undefined,
1404
- Description: undefined,
1405
- HlsPackage: undefined,
1406
- Id: undefined,
1407
- ManifestName: undefined,
1408
- MssPackage: undefined,
1409
- Origination: undefined,
1410
- StartoverWindowSeconds: undefined,
1411
- Tags: undefined,
1412
- TimeDelaySeconds: undefined,
1413
- Url: undefined,
1414
- Whitelist: undefined,
1415
- };
1232
+ });
1416
1233
  _a = __expectNonNull;
1417
1234
  _b = __expectObject;
1418
1235
  return [4, parseBody(output.body, context)];
1419
1236
  case 1:
1420
1237
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1421
- if (data.arn !== undefined && data.arn !== null) {
1238
+ if (data.arn != null) {
1422
1239
  contents.Arn = __expectString(data.arn);
1423
1240
  }
1424
- if (data.authorization !== undefined && data.authorization !== null) {
1241
+ if (data.authorization != null) {
1425
1242
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1426
1243
  }
1427
- if (data.channelId !== undefined && data.channelId !== null) {
1244
+ if (data.channelId != null) {
1428
1245
  contents.ChannelId = __expectString(data.channelId);
1429
1246
  }
1430
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
1247
+ if (data.cmafPackage != null) {
1431
1248
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
1432
1249
  }
1433
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
1250
+ if (data.dashPackage != null) {
1434
1251
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
1435
1252
  }
1436
- if (data.description !== undefined && data.description !== null) {
1253
+ if (data.description != null) {
1437
1254
  contents.Description = __expectString(data.description);
1438
1255
  }
1439
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
1256
+ if (data.hlsPackage != null) {
1440
1257
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
1441
1258
  }
1442
- if (data.id !== undefined && data.id !== null) {
1259
+ if (data.id != null) {
1443
1260
  contents.Id = __expectString(data.id);
1444
1261
  }
1445
- if (data.manifestName !== undefined && data.manifestName !== null) {
1262
+ if (data.manifestName != null) {
1446
1263
  contents.ManifestName = __expectString(data.manifestName);
1447
1264
  }
1448
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
1265
+ if (data.mssPackage != null) {
1449
1266
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
1450
1267
  }
1451
- if (data.origination !== undefined && data.origination !== null) {
1268
+ if (data.origination != null) {
1452
1269
  contents.Origination = __expectString(data.origination);
1453
1270
  }
1454
- if (data.startoverWindowSeconds !== undefined && data.startoverWindowSeconds !== null) {
1271
+ if (data.startoverWindowSeconds != null) {
1455
1272
  contents.StartoverWindowSeconds = __expectInt32(data.startoverWindowSeconds);
1456
1273
  }
1457
- if (data.tags !== undefined && data.tags !== null) {
1274
+ if (data.tags != null) {
1458
1275
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1459
1276
  }
1460
- if (data.timeDelaySeconds !== undefined && data.timeDelaySeconds !== null) {
1277
+ if (data.timeDelaySeconds != null) {
1461
1278
  contents.TimeDelaySeconds = __expectInt32(data.timeDelaySeconds);
1462
1279
  }
1463
- if (data.url !== undefined && data.url !== null) {
1280
+ if (data.url != null) {
1464
1281
  contents.Url = __expectString(data.url);
1465
1282
  }
1466
- if (data.whitelist !== undefined && data.whitelist !== null) {
1283
+ if (data.whitelist != null) {
1467
1284
  contents.Whitelist = deserializeAws_restJson1__listOf__string(data.whitelist, context);
1468
1285
  }
1469
- return [2, Promise.resolve(contents)];
1286
+ return [2, contents];
1470
1287
  }
1471
1288
  });
1472
1289
  }); };
1473
1290
  var deserializeAws_restJson1DescribeOriginEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1474
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1291
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1475
1292
  var _c;
1476
1293
  return __generator(this, function (_d) {
1477
1294
  switch (_d.label) {
@@ -1512,14 +1329,14 @@ var deserializeAws_restJson1DescribeOriginEndpointCommandError = function (outpu
1512
1329
  case 13: throw _d.sent();
1513
1330
  case 14:
1514
1331
  parsedBody = parsedOutput.body;
1515
- $metadata = deserializeMetadata(output);
1516
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1517
- response = new __BaseException({
1518
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1519
- $fault: "client",
1520
- $metadata: $metadata,
1332
+ throwDefaultError({
1333
+ output: output,
1334
+ parsedBody: parsedBody,
1335
+ exceptionCtor: __BaseException,
1336
+ errorCode: errorCode,
1521
1337
  });
1522
- throw __decorateServiceException(response, parsedBody);
1338
+ _d.label = 15;
1339
+ case 15: return [2];
1523
1340
  }
1524
1341
  });
1525
1342
  }); };
@@ -1531,28 +1348,26 @@ export var deserializeAws_restJson1ListChannelsCommand = function (output, conte
1531
1348
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1532
1349
  return [2, deserializeAws_restJson1ListChannelsCommandError(output, context)];
1533
1350
  }
1534
- contents = {
1351
+ contents = map({
1535
1352
  $metadata: deserializeMetadata(output),
1536
- Channels: undefined,
1537
- NextToken: undefined,
1538
- };
1353
+ });
1539
1354
  _a = __expectNonNull;
1540
1355
  _b = __expectObject;
1541
1356
  return [4, parseBody(output.body, context)];
1542
1357
  case 1:
1543
1358
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1544
- if (data.channels !== undefined && data.channels !== null) {
1359
+ if (data.channels != null) {
1545
1360
  contents.Channels = deserializeAws_restJson1__listOfChannel(data.channels, context);
1546
1361
  }
1547
- if (data.nextToken !== undefined && data.nextToken !== null) {
1362
+ if (data.nextToken != null) {
1548
1363
  contents.NextToken = __expectString(data.nextToken);
1549
1364
  }
1550
- return [2, Promise.resolve(contents)];
1365
+ return [2, contents];
1551
1366
  }
1552
1367
  });
1553
1368
  }); };
1554
1369
  var deserializeAws_restJson1ListChannelsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1555
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1370
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1556
1371
  var _c;
1557
1372
  return __generator(this, function (_d) {
1558
1373
  switch (_d.label) {
@@ -1593,14 +1408,14 @@ var deserializeAws_restJson1ListChannelsCommandError = function (output, context
1593
1408
  case 13: throw _d.sent();
1594
1409
  case 14:
1595
1410
  parsedBody = parsedOutput.body;
1596
- $metadata = deserializeMetadata(output);
1597
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1598
- response = new __BaseException({
1599
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1600
- $fault: "client",
1601
- $metadata: $metadata,
1411
+ throwDefaultError({
1412
+ output: output,
1413
+ parsedBody: parsedBody,
1414
+ exceptionCtor: __BaseException,
1415
+ errorCode: errorCode,
1602
1416
  });
1603
- throw __decorateServiceException(response, parsedBody);
1417
+ _d.label = 15;
1418
+ case 15: return [2];
1604
1419
  }
1605
1420
  });
1606
1421
  }); };
@@ -1612,28 +1427,26 @@ export var deserializeAws_restJson1ListHarvestJobsCommand = function (output, co
1612
1427
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1613
1428
  return [2, deserializeAws_restJson1ListHarvestJobsCommandError(output, context)];
1614
1429
  }
1615
- contents = {
1430
+ contents = map({
1616
1431
  $metadata: deserializeMetadata(output),
1617
- HarvestJobs: undefined,
1618
- NextToken: undefined,
1619
- };
1432
+ });
1620
1433
  _a = __expectNonNull;
1621
1434
  _b = __expectObject;
1622
1435
  return [4, parseBody(output.body, context)];
1623
1436
  case 1:
1624
1437
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1625
- if (data.harvestJobs !== undefined && data.harvestJobs !== null) {
1438
+ if (data.harvestJobs != null) {
1626
1439
  contents.HarvestJobs = deserializeAws_restJson1__listOfHarvestJob(data.harvestJobs, context);
1627
1440
  }
1628
- if (data.nextToken !== undefined && data.nextToken !== null) {
1441
+ if (data.nextToken != null) {
1629
1442
  contents.NextToken = __expectString(data.nextToken);
1630
1443
  }
1631
- return [2, Promise.resolve(contents)];
1444
+ return [2, contents];
1632
1445
  }
1633
1446
  });
1634
1447
  }); };
1635
1448
  var deserializeAws_restJson1ListHarvestJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1636
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1449
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1637
1450
  var _c;
1638
1451
  return __generator(this, function (_d) {
1639
1452
  switch (_d.label) {
@@ -1674,14 +1487,14 @@ var deserializeAws_restJson1ListHarvestJobsCommandError = function (output, cont
1674
1487
  case 13: throw _d.sent();
1675
1488
  case 14:
1676
1489
  parsedBody = parsedOutput.body;
1677
- $metadata = deserializeMetadata(output);
1678
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1679
- response = new __BaseException({
1680
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1681
- $fault: "client",
1682
- $metadata: $metadata,
1490
+ throwDefaultError({
1491
+ output: output,
1492
+ parsedBody: parsedBody,
1493
+ exceptionCtor: __BaseException,
1494
+ errorCode: errorCode,
1683
1495
  });
1684
- throw __decorateServiceException(response, parsedBody);
1496
+ _d.label = 15;
1497
+ case 15: return [2];
1685
1498
  }
1686
1499
  });
1687
1500
  }); };
@@ -1693,28 +1506,26 @@ export var deserializeAws_restJson1ListOriginEndpointsCommand = function (output
1693
1506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1694
1507
  return [2, deserializeAws_restJson1ListOriginEndpointsCommandError(output, context)];
1695
1508
  }
1696
- contents = {
1509
+ contents = map({
1697
1510
  $metadata: deserializeMetadata(output),
1698
- NextToken: undefined,
1699
- OriginEndpoints: undefined,
1700
- };
1511
+ });
1701
1512
  _a = __expectNonNull;
1702
1513
  _b = __expectObject;
1703
1514
  return [4, parseBody(output.body, context)];
1704
1515
  case 1:
1705
1516
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1706
- if (data.nextToken !== undefined && data.nextToken !== null) {
1517
+ if (data.nextToken != null) {
1707
1518
  contents.NextToken = __expectString(data.nextToken);
1708
1519
  }
1709
- if (data.originEndpoints !== undefined && data.originEndpoints !== null) {
1520
+ if (data.originEndpoints != null) {
1710
1521
  contents.OriginEndpoints = deserializeAws_restJson1__listOfOriginEndpoint(data.originEndpoints, context);
1711
1522
  }
1712
- return [2, Promise.resolve(contents)];
1523
+ return [2, contents];
1713
1524
  }
1714
1525
  });
1715
1526
  }); };
1716
1527
  var deserializeAws_restJson1ListOriginEndpointsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1717
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1528
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1718
1529
  var _c;
1719
1530
  return __generator(this, function (_d) {
1720
1531
  switch (_d.label) {
@@ -1755,14 +1566,14 @@ var deserializeAws_restJson1ListOriginEndpointsCommandError = function (output,
1755
1566
  case 13: throw _d.sent();
1756
1567
  case 14:
1757
1568
  parsedBody = parsedOutput.body;
1758
- $metadata = deserializeMetadata(output);
1759
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1760
- response = new __BaseException({
1761
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1762
- $fault: "client",
1763
- $metadata: $metadata,
1569
+ throwDefaultError({
1570
+ output: output,
1571
+ parsedBody: parsedBody,
1572
+ exceptionCtor: __BaseException,
1573
+ errorCode: errorCode,
1764
1574
  });
1765
- throw __decorateServiceException(response, parsedBody);
1575
+ _d.label = 15;
1576
+ case 15: return [2];
1766
1577
  }
1767
1578
  });
1768
1579
  }); };
@@ -1774,24 +1585,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1774
1585
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1775
1586
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1776
1587
  }
1777
- contents = {
1588
+ contents = map({
1778
1589
  $metadata: deserializeMetadata(output),
1779
- Tags: undefined,
1780
- };
1590
+ });
1781
1591
  _a = __expectNonNull;
1782
1592
  _b = __expectObject;
1783
1593
  return [4, parseBody(output.body, context)];
1784
1594
  case 1:
1785
1595
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1786
- if (data.tags !== undefined && data.tags !== null) {
1596
+ if (data.tags != null) {
1787
1597
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1788
1598
  }
1789
- return [2, Promise.resolve(contents)];
1599
+ return [2, contents];
1790
1600
  }
1791
1601
  });
1792
1602
  }); };
1793
1603
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1794
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1604
+ var parsedOutput, _a, errorCode, parsedBody;
1795
1605
  var _b;
1796
1606
  return __generator(this, function (_c) {
1797
1607
  switch (_c.label) {
@@ -1802,18 +1612,13 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1802
1612
  case 1:
1803
1613
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1804
1614
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1805
- switch (errorCode) {
1806
- default:
1807
- parsedBody = parsedOutput.body;
1808
- $metadata = deserializeMetadata(output);
1809
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1810
- response = new __BaseException({
1811
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1812
- $fault: "client",
1813
- $metadata: $metadata,
1814
- });
1815
- throw __decorateServiceException(response, parsedBody);
1816
- }
1615
+ parsedBody = parsedOutput.body;
1616
+ throwDefaultError({
1617
+ output: output,
1618
+ parsedBody: parsedBody,
1619
+ exceptionCtor: __BaseException,
1620
+ errorCode: errorCode,
1621
+ });
1817
1622
  return [2];
1818
1623
  }
1819
1624
  });
@@ -1826,48 +1631,41 @@ export var deserializeAws_restJson1RotateChannelCredentialsCommand = function (o
1826
1631
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1827
1632
  return [2, deserializeAws_restJson1RotateChannelCredentialsCommandError(output, context)];
1828
1633
  }
1829
- contents = {
1634
+ contents = map({
1830
1635
  $metadata: deserializeMetadata(output),
1831
- Arn: undefined,
1832
- Description: undefined,
1833
- EgressAccessLogs: undefined,
1834
- HlsIngest: undefined,
1835
- Id: undefined,
1836
- IngressAccessLogs: undefined,
1837
- Tags: undefined,
1838
- };
1636
+ });
1839
1637
  _a = __expectNonNull;
1840
1638
  _b = __expectObject;
1841
1639
  return [4, parseBody(output.body, context)];
1842
1640
  case 1:
1843
1641
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1844
- if (data.arn !== undefined && data.arn !== null) {
1642
+ if (data.arn != null) {
1845
1643
  contents.Arn = __expectString(data.arn);
1846
1644
  }
1847
- if (data.description !== undefined && data.description !== null) {
1645
+ if (data.description != null) {
1848
1646
  contents.Description = __expectString(data.description);
1849
1647
  }
1850
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1648
+ if (data.egressAccessLogs != null) {
1851
1649
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1852
1650
  }
1853
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1651
+ if (data.hlsIngest != null) {
1854
1652
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1855
1653
  }
1856
- if (data.id !== undefined && data.id !== null) {
1654
+ if (data.id != null) {
1857
1655
  contents.Id = __expectString(data.id);
1858
1656
  }
1859
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1657
+ if (data.ingressAccessLogs != null) {
1860
1658
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1861
1659
  }
1862
- if (data.tags !== undefined && data.tags !== null) {
1660
+ if (data.tags != null) {
1863
1661
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1864
1662
  }
1865
- return [2, Promise.resolve(contents)];
1663
+ return [2, contents];
1866
1664
  }
1867
1665
  });
1868
1666
  }); };
1869
1667
  var deserializeAws_restJson1RotateChannelCredentialsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1870
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1668
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1871
1669
  var _c;
1872
1670
  return __generator(this, function (_d) {
1873
1671
  switch (_d.label) {
@@ -1908,14 +1706,14 @@ var deserializeAws_restJson1RotateChannelCredentialsCommandError = function (out
1908
1706
  case 13: throw _d.sent();
1909
1707
  case 14:
1910
1708
  parsedBody = parsedOutput.body;
1911
- $metadata = deserializeMetadata(output);
1912
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1913
- response = new __BaseException({
1914
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1915
- $fault: "client",
1916
- $metadata: $metadata,
1709
+ throwDefaultError({
1710
+ output: output,
1711
+ parsedBody: parsedBody,
1712
+ exceptionCtor: __BaseException,
1713
+ errorCode: errorCode,
1917
1714
  });
1918
- throw __decorateServiceException(response, parsedBody);
1715
+ _d.label = 15;
1716
+ case 15: return [2];
1919
1717
  }
1920
1718
  });
1921
1719
  }); };
@@ -1927,48 +1725,41 @@ export var deserializeAws_restJson1RotateIngestEndpointCredentialsCommand = func
1927
1725
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1928
1726
  return [2, deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError(output, context)];
1929
1727
  }
1930
- contents = {
1728
+ contents = map({
1931
1729
  $metadata: deserializeMetadata(output),
1932
- Arn: undefined,
1933
- Description: undefined,
1934
- EgressAccessLogs: undefined,
1935
- HlsIngest: undefined,
1936
- Id: undefined,
1937
- IngressAccessLogs: undefined,
1938
- Tags: undefined,
1939
- };
1730
+ });
1940
1731
  _a = __expectNonNull;
1941
1732
  _b = __expectObject;
1942
1733
  return [4, parseBody(output.body, context)];
1943
1734
  case 1:
1944
1735
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1945
- if (data.arn !== undefined && data.arn !== null) {
1736
+ if (data.arn != null) {
1946
1737
  contents.Arn = __expectString(data.arn);
1947
1738
  }
1948
- if (data.description !== undefined && data.description !== null) {
1739
+ if (data.description != null) {
1949
1740
  contents.Description = __expectString(data.description);
1950
1741
  }
1951
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1742
+ if (data.egressAccessLogs != null) {
1952
1743
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1953
1744
  }
1954
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1745
+ if (data.hlsIngest != null) {
1955
1746
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1956
1747
  }
1957
- if (data.id !== undefined && data.id !== null) {
1748
+ if (data.id != null) {
1958
1749
  contents.Id = __expectString(data.id);
1959
1750
  }
1960
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1751
+ if (data.ingressAccessLogs != null) {
1961
1752
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1962
1753
  }
1963
- if (data.tags !== undefined && data.tags !== null) {
1754
+ if (data.tags != null) {
1964
1755
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1965
1756
  }
1966
- return [2, Promise.resolve(contents)];
1757
+ return [2, contents];
1967
1758
  }
1968
1759
  });
1969
1760
  }); };
1970
1761
  var deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1971
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1762
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1972
1763
  var _c;
1973
1764
  return __generator(this, function (_d) {
1974
1765
  switch (_d.label) {
@@ -2009,14 +1800,14 @@ var deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError = functi
2009
1800
  case 13: throw _d.sent();
2010
1801
  case 14:
2011
1802
  parsedBody = parsedOutput.body;
2012
- $metadata = deserializeMetadata(output);
2013
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2014
- response = new __BaseException({
2015
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2016
- $fault: "client",
2017
- $metadata: $metadata,
1803
+ throwDefaultError({
1804
+ output: output,
1805
+ parsedBody: parsedBody,
1806
+ exceptionCtor: __BaseException,
1807
+ errorCode: errorCode,
2018
1808
  });
2019
- throw __decorateServiceException(response, parsedBody);
1809
+ _d.label = 15;
1810
+ case 15: return [2];
2020
1811
  }
2021
1812
  });
2022
1813
  }); };
@@ -2028,18 +1819,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2028
1819
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2029
1820
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2030
1821
  }
2031
- contents = {
1822
+ contents = map({
2032
1823
  $metadata: deserializeMetadata(output),
2033
- };
1824
+ });
2034
1825
  return [4, collectBody(output.body, context)];
2035
1826
  case 1:
2036
1827
  _a.sent();
2037
- return [2, Promise.resolve(contents)];
1828
+ return [2, contents];
2038
1829
  }
2039
1830
  });
2040
1831
  }); };
2041
1832
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2042
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1833
+ var parsedOutput, _a, errorCode, parsedBody;
2043
1834
  var _b;
2044
1835
  return __generator(this, function (_c) {
2045
1836
  switch (_c.label) {
@@ -2050,18 +1841,13 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2050
1841
  case 1:
2051
1842
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2052
1843
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2053
- switch (errorCode) {
2054
- default:
2055
- parsedBody = parsedOutput.body;
2056
- $metadata = deserializeMetadata(output);
2057
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2058
- response = new __BaseException({
2059
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2060
- $fault: "client",
2061
- $metadata: $metadata,
2062
- });
2063
- throw __decorateServiceException(response, parsedBody);
2064
- }
1844
+ parsedBody = parsedOutput.body;
1845
+ throwDefaultError({
1846
+ output: output,
1847
+ parsedBody: parsedBody,
1848
+ exceptionCtor: __BaseException,
1849
+ errorCode: errorCode,
1850
+ });
2065
1851
  return [2];
2066
1852
  }
2067
1853
  });
@@ -2074,18 +1860,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2074
1860
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2075
1861
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2076
1862
  }
2077
- contents = {
1863
+ contents = map({
2078
1864
  $metadata: deserializeMetadata(output),
2079
- };
1865
+ });
2080
1866
  return [4, collectBody(output.body, context)];
2081
1867
  case 1:
2082
1868
  _a.sent();
2083
- return [2, Promise.resolve(contents)];
1869
+ return [2, contents];
2084
1870
  }
2085
1871
  });
2086
1872
  }); };
2087
1873
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2088
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1874
+ var parsedOutput, _a, errorCode, parsedBody;
2089
1875
  var _b;
2090
1876
  return __generator(this, function (_c) {
2091
1877
  switch (_c.label) {
@@ -2096,18 +1882,13 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2096
1882
  case 1:
2097
1883
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2098
1884
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2099
- switch (errorCode) {
2100
- default:
2101
- parsedBody = parsedOutput.body;
2102
- $metadata = deserializeMetadata(output);
2103
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2104
- response = new __BaseException({
2105
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2106
- $fault: "client",
2107
- $metadata: $metadata,
2108
- });
2109
- throw __decorateServiceException(response, parsedBody);
2110
- }
1885
+ parsedBody = parsedOutput.body;
1886
+ throwDefaultError({
1887
+ output: output,
1888
+ parsedBody: parsedBody,
1889
+ exceptionCtor: __BaseException,
1890
+ errorCode: errorCode,
1891
+ });
2111
1892
  return [2];
2112
1893
  }
2113
1894
  });
@@ -2120,48 +1901,41 @@ export var deserializeAws_restJson1UpdateChannelCommand = function (output, cont
2120
1901
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2121
1902
  return [2, deserializeAws_restJson1UpdateChannelCommandError(output, context)];
2122
1903
  }
2123
- contents = {
1904
+ contents = map({
2124
1905
  $metadata: deserializeMetadata(output),
2125
- Arn: undefined,
2126
- Description: undefined,
2127
- EgressAccessLogs: undefined,
2128
- HlsIngest: undefined,
2129
- Id: undefined,
2130
- IngressAccessLogs: undefined,
2131
- Tags: undefined,
2132
- };
1906
+ });
2133
1907
  _a = __expectNonNull;
2134
1908
  _b = __expectObject;
2135
1909
  return [4, parseBody(output.body, context)];
2136
1910
  case 1:
2137
1911
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2138
- if (data.arn !== undefined && data.arn !== null) {
1912
+ if (data.arn != null) {
2139
1913
  contents.Arn = __expectString(data.arn);
2140
1914
  }
2141
- if (data.description !== undefined && data.description !== null) {
1915
+ if (data.description != null) {
2142
1916
  contents.Description = __expectString(data.description);
2143
1917
  }
2144
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1918
+ if (data.egressAccessLogs != null) {
2145
1919
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
2146
1920
  }
2147
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1921
+ if (data.hlsIngest != null) {
2148
1922
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
2149
1923
  }
2150
- if (data.id !== undefined && data.id !== null) {
1924
+ if (data.id != null) {
2151
1925
  contents.Id = __expectString(data.id);
2152
1926
  }
2153
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1927
+ if (data.ingressAccessLogs != null) {
2154
1928
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
2155
1929
  }
2156
- if (data.tags !== undefined && data.tags !== null) {
1930
+ if (data.tags != null) {
2157
1931
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
2158
1932
  }
2159
- return [2, Promise.resolve(contents)];
1933
+ return [2, contents];
2160
1934
  }
2161
1935
  });
2162
1936
  }); };
2163
1937
  var deserializeAws_restJson1UpdateChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2164
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1938
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2165
1939
  var _c;
2166
1940
  return __generator(this, function (_d) {
2167
1941
  switch (_d.label) {
@@ -2202,14 +1976,14 @@ var deserializeAws_restJson1UpdateChannelCommandError = function (output, contex
2202
1976
  case 13: throw _d.sent();
2203
1977
  case 14:
2204
1978
  parsedBody = parsedOutput.body;
2205
- $metadata = deserializeMetadata(output);
2206
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2207
- response = new __BaseException({
2208
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2209
- $fault: "client",
2210
- $metadata: $metadata,
1979
+ throwDefaultError({
1980
+ output: output,
1981
+ parsedBody: parsedBody,
1982
+ exceptionCtor: __BaseException,
1983
+ errorCode: errorCode,
2211
1984
  });
2212
- throw __decorateServiceException(response, parsedBody);
1985
+ _d.label = 15;
1986
+ case 15: return [2];
2213
1987
  }
2214
1988
  });
2215
1989
  }); };
@@ -2221,84 +1995,68 @@ export var deserializeAws_restJson1UpdateOriginEndpointCommand = function (outpu
2221
1995
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2222
1996
  return [2, deserializeAws_restJson1UpdateOriginEndpointCommandError(output, context)];
2223
1997
  }
2224
- contents = {
1998
+ contents = map({
2225
1999
  $metadata: deserializeMetadata(output),
2226
- Arn: undefined,
2227
- Authorization: undefined,
2228
- ChannelId: undefined,
2229
- CmafPackage: undefined,
2230
- DashPackage: undefined,
2231
- Description: undefined,
2232
- HlsPackage: undefined,
2233
- Id: undefined,
2234
- ManifestName: undefined,
2235
- MssPackage: undefined,
2236
- Origination: undefined,
2237
- StartoverWindowSeconds: undefined,
2238
- Tags: undefined,
2239
- TimeDelaySeconds: undefined,
2240
- Url: undefined,
2241
- Whitelist: undefined,
2242
- };
2000
+ });
2243
2001
  _a = __expectNonNull;
2244
2002
  _b = __expectObject;
2245
2003
  return [4, parseBody(output.body, context)];
2246
2004
  case 1:
2247
2005
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2248
- if (data.arn !== undefined && data.arn !== null) {
2006
+ if (data.arn != null) {
2249
2007
  contents.Arn = __expectString(data.arn);
2250
2008
  }
2251
- if (data.authorization !== undefined && data.authorization !== null) {
2009
+ if (data.authorization != null) {
2252
2010
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
2253
2011
  }
2254
- if (data.channelId !== undefined && data.channelId !== null) {
2012
+ if (data.channelId != null) {
2255
2013
  contents.ChannelId = __expectString(data.channelId);
2256
2014
  }
2257
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
2015
+ if (data.cmafPackage != null) {
2258
2016
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
2259
2017
  }
2260
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
2018
+ if (data.dashPackage != null) {
2261
2019
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
2262
2020
  }
2263
- if (data.description !== undefined && data.description !== null) {
2021
+ if (data.description != null) {
2264
2022
  contents.Description = __expectString(data.description);
2265
2023
  }
2266
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
2024
+ if (data.hlsPackage != null) {
2267
2025
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
2268
2026
  }
2269
- if (data.id !== undefined && data.id !== null) {
2027
+ if (data.id != null) {
2270
2028
  contents.Id = __expectString(data.id);
2271
2029
  }
2272
- if (data.manifestName !== undefined && data.manifestName !== null) {
2030
+ if (data.manifestName != null) {
2273
2031
  contents.ManifestName = __expectString(data.manifestName);
2274
2032
  }
2275
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
2033
+ if (data.mssPackage != null) {
2276
2034
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
2277
2035
  }
2278
- if (data.origination !== undefined && data.origination !== null) {
2036
+ if (data.origination != null) {
2279
2037
  contents.Origination = __expectString(data.origination);
2280
2038
  }
2281
- if (data.startoverWindowSeconds !== undefined && data.startoverWindowSeconds !== null) {
2039
+ if (data.startoverWindowSeconds != null) {
2282
2040
  contents.StartoverWindowSeconds = __expectInt32(data.startoverWindowSeconds);
2283
2041
  }
2284
- if (data.tags !== undefined && data.tags !== null) {
2042
+ if (data.tags != null) {
2285
2043
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
2286
2044
  }
2287
- if (data.timeDelaySeconds !== undefined && data.timeDelaySeconds !== null) {
2045
+ if (data.timeDelaySeconds != null) {
2288
2046
  contents.TimeDelaySeconds = __expectInt32(data.timeDelaySeconds);
2289
2047
  }
2290
- if (data.url !== undefined && data.url !== null) {
2048
+ if (data.url != null) {
2291
2049
  contents.Url = __expectString(data.url);
2292
2050
  }
2293
- if (data.whitelist !== undefined && data.whitelist !== null) {
2051
+ if (data.whitelist != null) {
2294
2052
  contents.Whitelist = deserializeAws_restJson1__listOf__string(data.whitelist, context);
2295
2053
  }
2296
- return [2, Promise.resolve(contents)];
2054
+ return [2, contents];
2297
2055
  }
2298
2056
  });
2299
2057
  }); };
2300
2058
  var deserializeAws_restJson1UpdateOriginEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2301
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2059
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2302
2060
  var _c;
2303
2061
  return __generator(this, function (_d) {
2304
2062
  switch (_d.label) {
@@ -2339,23 +2097,24 @@ var deserializeAws_restJson1UpdateOriginEndpointCommandError = function (output,
2339
2097
  case 13: throw _d.sent();
2340
2098
  case 14:
2341
2099
  parsedBody = parsedOutput.body;
2342
- $metadata = deserializeMetadata(output);
2343
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2344
- response = new __BaseException({
2345
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2346
- $fault: "client",
2347
- $metadata: $metadata,
2100
+ throwDefaultError({
2101
+ output: output,
2102
+ parsedBody: parsedBody,
2103
+ exceptionCtor: __BaseException,
2104
+ errorCode: errorCode,
2348
2105
  });
2349
- throw __decorateServiceException(response, parsedBody);
2106
+ _d.label = 15;
2107
+ case 15: return [2];
2350
2108
  }
2351
2109
  });
2352
2110
  }); };
2111
+ var map = __map;
2353
2112
  var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2354
2113
  var contents, data, exception;
2355
2114
  return __generator(this, function (_a) {
2356
- contents = {};
2115
+ contents = map({});
2357
2116
  data = parsedOutput.body;
2358
- if (data.message !== undefined && data.message !== null) {
2117
+ if (data.message != null) {
2359
2118
  contents.Message = __expectString(data.message);
2360
2119
  }
2361
2120
  exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2365,9 +2124,9 @@ var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput,
2365
2124
  var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2366
2125
  var contents, data, exception;
2367
2126
  return __generator(this, function (_a) {
2368
- contents = {};
2127
+ contents = map({});
2369
2128
  data = parsedOutput.body;
2370
- if (data.message !== undefined && data.message !== null) {
2129
+ if (data.message != null) {
2371
2130
  contents.Message = __expectString(data.message);
2372
2131
  }
2373
2132
  exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2377,9 +2136,9 @@ var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (par
2377
2136
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2378
2137
  var contents, data, exception;
2379
2138
  return __generator(this, function (_a) {
2380
- contents = {};
2139
+ contents = map({});
2381
2140
  data = parsedOutput.body;
2382
- if (data.message !== undefined && data.message !== null) {
2141
+ if (data.message != null) {
2383
2142
  contents.Message = __expectString(data.message);
2384
2143
  }
2385
2144
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2389,9 +2148,9 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
2389
2148
  var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2390
2149
  var contents, data, exception;
2391
2150
  return __generator(this, function (_a) {
2392
- contents = {};
2151
+ contents = map({});
2393
2152
  data = parsedOutput.body;
2394
- if (data.message !== undefined && data.message !== null) {
2153
+ if (data.message != null) {
2395
2154
  contents.Message = __expectString(data.message);
2396
2155
  }
2397
2156
  exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2401,9 +2160,9 @@ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (pars
2401
2160
  var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2402
2161
  var contents, data, exception;
2403
2162
  return __generator(this, function (_a) {
2404
- contents = {};
2163
+ contents = map({});
2405
2164
  data = parsedOutput.body;
2406
- if (data.message !== undefined && data.message !== null) {
2165
+ if (data.message != null) {
2407
2166
  contents.Message = __expectString(data.message);
2408
2167
  }
2409
2168
  exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2413,9 +2172,9 @@ var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedO
2413
2172
  var deserializeAws_restJson1UnprocessableEntityExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2414
2173
  var contents, data, exception;
2415
2174
  return __generator(this, function (_a) {
2416
- contents = {};
2175
+ contents = map({});
2417
2176
  data = parsedOutput.body;
2418
- if (data.message !== undefined && data.message !== null) {
2177
+ if (data.message != null) {
2419
2178
  contents.Message = __expectString(data.message);
2420
2179
  }
2421
2180
  exception = new UnprocessableEntityException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2426,9 +2185,6 @@ var serializeAws_restJson1__listOf__PeriodTriggersElement = function (input, con
2426
2185
  return input
2427
2186
  .filter(function (e) { return e != null; })
2428
2187
  .map(function (entry) {
2429
- if (entry === null) {
2430
- return null;
2431
- }
2432
2188
  return entry;
2433
2189
  });
2434
2190
  };
@@ -2436,9 +2192,6 @@ var serializeAws_restJson1__listOf__string = function (input, context) {
2436
2192
  return input
2437
2193
  .filter(function (e) { return e != null; })
2438
2194
  .map(function (entry) {
2439
- if (entry === null) {
2440
- return null;
2441
- }
2442
2195
  return entry;
2443
2196
  });
2444
2197
  };
@@ -2446,9 +2199,6 @@ var serializeAws_restJson1__listOfHlsManifestCreateOrUpdateParameters = function
2446
2199
  return input
2447
2200
  .filter(function (e) { return e != null; })
2448
2201
  .map(function (entry) {
2449
- if (entry === null) {
2450
- return null;
2451
- }
2452
2202
  return serializeAws_restJson1HlsManifestCreateOrUpdateParameters(entry, context);
2453
2203
  });
2454
2204
  };
@@ -2466,9 +2216,6 @@ var serializeAws_restJson1AdTriggers = function (input, context) {
2466
2216
  return input
2467
2217
  .filter(function (e) { return e != null; })
2468
2218
  .map(function (entry) {
2469
- if (entry === null) {
2470
- return null;
2471
- }
2472
2219
  return entry;
2473
2220
  });
2474
2221
  };