@aws-sdk/client-mediapackage-vod 3.137.0 → 3.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,16 +11,7 @@ const serializeAws_restJson1ConfigureLogsCommand = async (input, context) => {
11
11
  "content-type": "application/json",
12
12
  };
13
13
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}/configure_logs";
14
- if (input.Id !== undefined) {
15
- const labelValue = input.Id;
16
- if (labelValue.length <= 0) {
17
- throw new Error("Empty value provided for input HTTP label: Id.");
18
- }
19
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
20
- }
21
- else {
22
- throw new Error("No value provided for input HTTP label: Id.");
23
- }
14
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
24
15
  let body;
25
16
  body = JSON.stringify({
26
17
  ...(input.EgressAccessLogs != null && {
@@ -123,16 +114,7 @@ const serializeAws_restJson1DeleteAssetCommand = async (input, context) => {
123
114
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
124
115
  const headers = {};
125
116
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assets/{Id}";
126
- if (input.Id !== undefined) {
127
- const labelValue = input.Id;
128
- if (labelValue.length <= 0) {
129
- throw new Error("Empty value provided for input HTTP label: Id.");
130
- }
131
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
132
- }
133
- else {
134
- throw new Error("No value provided for input HTTP label: Id.");
135
- }
117
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
136
118
  let body;
137
119
  return new protocol_http_1.HttpRequest({
138
120
  protocol,
@@ -149,16 +131,7 @@ const serializeAws_restJson1DeletePackagingConfigurationCommand = async (input,
149
131
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
150
132
  const headers = {};
151
133
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations/{Id}";
152
- if (input.Id !== undefined) {
153
- const labelValue = input.Id;
154
- if (labelValue.length <= 0) {
155
- throw new Error("Empty value provided for input HTTP label: Id.");
156
- }
157
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
158
- }
159
- else {
160
- throw new Error("No value provided for input HTTP label: Id.");
161
- }
134
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
162
135
  let body;
163
136
  return new protocol_http_1.HttpRequest({
164
137
  protocol,
@@ -175,16 +148,7 @@ const serializeAws_restJson1DeletePackagingGroupCommand = async (input, context)
175
148
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
176
149
  const headers = {};
177
150
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}";
178
- if (input.Id !== undefined) {
179
- const labelValue = input.Id;
180
- if (labelValue.length <= 0) {
181
- throw new Error("Empty value provided for input HTTP label: Id.");
182
- }
183
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
184
- }
185
- else {
186
- throw new Error("No value provided for input HTTP label: Id.");
187
- }
151
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
188
152
  let body;
189
153
  return new protocol_http_1.HttpRequest({
190
154
  protocol,
@@ -201,16 +165,7 @@ const serializeAws_restJson1DescribeAssetCommand = async (input, context) => {
201
165
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
202
166
  const headers = {};
203
167
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assets/{Id}";
204
- if (input.Id !== undefined) {
205
- const labelValue = input.Id;
206
- if (labelValue.length <= 0) {
207
- throw new Error("Empty value provided for input HTTP label: Id.");
208
- }
209
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
210
- }
211
- else {
212
- throw new Error("No value provided for input HTTP label: Id.");
213
- }
168
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
214
169
  let body;
215
170
  return new protocol_http_1.HttpRequest({
216
171
  protocol,
@@ -227,16 +182,7 @@ const serializeAws_restJson1DescribePackagingConfigurationCommand = async (input
227
182
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
228
183
  const headers = {};
229
184
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations/{Id}";
230
- if (input.Id !== undefined) {
231
- const labelValue = input.Id;
232
- if (labelValue.length <= 0) {
233
- throw new Error("Empty value provided for input HTTP label: Id.");
234
- }
235
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
236
- }
237
- else {
238
- throw new Error("No value provided for input HTTP label: Id.");
239
- }
185
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
240
186
  let body;
241
187
  return new protocol_http_1.HttpRequest({
242
188
  protocol,
@@ -253,16 +199,7 @@ const serializeAws_restJson1DescribePackagingGroupCommand = async (input, contex
253
199
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
254
200
  const headers = {};
255
201
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}";
256
- if (input.Id !== undefined) {
257
- const labelValue = input.Id;
258
- if (labelValue.length <= 0) {
259
- throw new Error("Empty value provided for input HTTP label: Id.");
260
- }
261
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
262
- }
263
- else {
264
- throw new Error("No value provided for input HTTP label: Id.");
265
- }
202
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
266
203
  let body;
267
204
  return new protocol_http_1.HttpRequest({
268
205
  protocol,
@@ -279,11 +216,11 @@ const serializeAws_restJson1ListAssetsCommand = async (input, context) => {
279
216
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
280
217
  const headers = {};
281
218
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assets";
282
- const query = {
283
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
284
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
285
- ...(input.PackagingGroupId !== undefined && { packagingGroupId: input.PackagingGroupId }),
286
- };
219
+ const query = map({
220
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
221
+ nextToken: [, input.NextToken],
222
+ packagingGroupId: [, input.PackagingGroupId],
223
+ });
287
224
  let body;
288
225
  return new protocol_http_1.HttpRequest({
289
226
  protocol,
@@ -301,11 +238,11 @@ const serializeAws_restJson1ListPackagingConfigurationsCommand = async (input, c
301
238
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
302
239
  const headers = {};
303
240
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations";
304
- const query = {
305
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
306
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
307
- ...(input.PackagingGroupId !== undefined && { packagingGroupId: input.PackagingGroupId }),
308
- };
241
+ const query = map({
242
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
243
+ nextToken: [, input.NextToken],
244
+ packagingGroupId: [, input.PackagingGroupId],
245
+ });
309
246
  let body;
310
247
  return new protocol_http_1.HttpRequest({
311
248
  protocol,
@@ -323,10 +260,10 @@ const serializeAws_restJson1ListPackagingGroupsCommand = async (input, context)
323
260
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
324
261
  const headers = {};
325
262
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups";
326
- const query = {
327
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
328
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
329
- };
263
+ const query = map({
264
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
265
+ nextToken: [, input.NextToken],
266
+ });
330
267
  let body;
331
268
  return new protocol_http_1.HttpRequest({
332
269
  protocol,
@@ -344,16 +281,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
344
281
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
345
282
  const headers = {};
346
283
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
347
- if (input.ResourceArn !== undefined) {
348
- const labelValue = input.ResourceArn;
349
- if (labelValue.length <= 0) {
350
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
351
- }
352
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
353
- }
354
- else {
355
- throw new Error("No value provided for input HTTP label: ResourceArn.");
356
- }
284
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
357
285
  let body;
358
286
  return new protocol_http_1.HttpRequest({
359
287
  protocol,
@@ -372,16 +300,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
372
300
  "content-type": "application/json",
373
301
  };
374
302
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
375
- if (input.ResourceArn !== undefined) {
376
- const labelValue = input.ResourceArn;
377
- if (labelValue.length <= 0) {
378
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
379
- }
380
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
381
- }
382
- else {
383
- throw new Error("No value provided for input HTTP label: ResourceArn.");
384
- }
303
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
385
304
  let body;
386
305
  body = JSON.stringify({
387
306
  ...(input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }),
@@ -401,19 +320,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
401
320
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
402
321
  const headers = {};
403
322
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
404
- if (input.ResourceArn !== undefined) {
405
- const labelValue = input.ResourceArn;
406
- if (labelValue.length <= 0) {
407
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
408
- }
409
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
410
- }
411
- else {
412
- throw new Error("No value provided for input HTTP label: ResourceArn.");
413
- }
414
- const query = {
415
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
416
- };
323
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
324
+ const query = map({
325
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
326
+ });
417
327
  let body;
418
328
  return new protocol_http_1.HttpRequest({
419
329
  protocol,
@@ -433,16 +343,7 @@ const serializeAws_restJson1UpdatePackagingGroupCommand = async (input, context)
433
343
  "content-type": "application/json",
434
344
  };
435
345
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}";
436
- if (input.Id !== undefined) {
437
- const labelValue = input.Id;
438
- if (labelValue.length <= 0) {
439
- throw new Error("Empty value provided for input HTTP label: Id.");
440
- }
441
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
442
- }
443
- else {
444
- throw new Error("No value provided for input HTTP label: Id.");
445
- }
346
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
446
347
  let body;
447
348
  body = JSON.stringify({
448
349
  ...(input.Authorization != null && {
@@ -464,35 +365,29 @@ const deserializeAws_restJson1ConfigureLogsCommand = async (output, context) =>
464
365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
465
366
  return deserializeAws_restJson1ConfigureLogsCommandError(output, context);
466
367
  }
467
- const contents = {
368
+ const contents = map({
468
369
  $metadata: deserializeMetadata(output),
469
- Arn: undefined,
470
- Authorization: undefined,
471
- DomainName: undefined,
472
- EgressAccessLogs: undefined,
473
- Id: undefined,
474
- Tags: undefined,
475
- };
370
+ });
476
371
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
477
- if (data.arn !== undefined && data.arn !== null) {
372
+ if (data.arn != null) {
478
373
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
479
374
  }
480
- if (data.authorization !== undefined && data.authorization !== null) {
375
+ if (data.authorization != null) {
481
376
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
482
377
  }
483
- if (data.domainName !== undefined && data.domainName !== null) {
378
+ if (data.domainName != null) {
484
379
  contents.DomainName = (0, smithy_client_1.expectString)(data.domainName);
485
380
  }
486
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
381
+ if (data.egressAccessLogs != null) {
487
382
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
488
383
  }
489
- if (data.id !== undefined && data.id !== null) {
384
+ if (data.id != null) {
490
385
  contents.Id = (0, smithy_client_1.expectString)(data.id);
491
386
  }
492
- if (data.tags !== undefined && data.tags !== null) {
387
+ if (data.tags != null) {
493
388
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
494
389
  }
495
- return Promise.resolve(contents);
390
+ return contents;
496
391
  };
497
392
  exports.deserializeAws_restJson1ConfigureLogsCommand = deserializeAws_restJson1ConfigureLogsCommand;
498
393
  const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context) => {
@@ -500,7 +395,6 @@ const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context
500
395
  ...output,
501
396
  body: await parseBody(output.body, context),
502
397
  };
503
- let response;
504
398
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
505
399
  switch (errorCode) {
506
400
  case "ForbiddenException":
@@ -523,61 +417,50 @@ const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context
523
417
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
524
418
  default:
525
419
  const parsedBody = parsedOutput.body;
526
- const $metadata = deserializeMetadata(output);
527
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
528
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
529
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
530
- $fault: "client",
531
- $metadata,
420
+ (0, smithy_client_1.throwDefaultError)({
421
+ output,
422
+ parsedBody,
423
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
424
+ errorCode,
532
425
  });
533
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
534
426
  }
535
427
  };
536
428
  const deserializeAws_restJson1CreateAssetCommand = async (output, context) => {
537
429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
538
430
  return deserializeAws_restJson1CreateAssetCommandError(output, context);
539
431
  }
540
- const contents = {
432
+ const contents = map({
541
433
  $metadata: deserializeMetadata(output),
542
- Arn: undefined,
543
- CreatedAt: undefined,
544
- EgressEndpoints: undefined,
545
- Id: undefined,
546
- PackagingGroupId: undefined,
547
- ResourceId: undefined,
548
- SourceArn: undefined,
549
- SourceRoleArn: undefined,
550
- Tags: undefined,
551
- };
434
+ });
552
435
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
553
- if (data.arn !== undefined && data.arn !== null) {
436
+ if (data.arn != null) {
554
437
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
555
438
  }
556
- if (data.createdAt !== undefined && data.createdAt !== null) {
439
+ if (data.createdAt != null) {
557
440
  contents.CreatedAt = (0, smithy_client_1.expectString)(data.createdAt);
558
441
  }
559
- if (data.egressEndpoints !== undefined && data.egressEndpoints !== null) {
442
+ if (data.egressEndpoints != null) {
560
443
  contents.EgressEndpoints = deserializeAws_restJson1__listOfEgressEndpoint(data.egressEndpoints, context);
561
444
  }
562
- if (data.id !== undefined && data.id !== null) {
445
+ if (data.id != null) {
563
446
  contents.Id = (0, smithy_client_1.expectString)(data.id);
564
447
  }
565
- if (data.packagingGroupId !== undefined && data.packagingGroupId !== null) {
448
+ if (data.packagingGroupId != null) {
566
449
  contents.PackagingGroupId = (0, smithy_client_1.expectString)(data.packagingGroupId);
567
450
  }
568
- if (data.resourceId !== undefined && data.resourceId !== null) {
451
+ if (data.resourceId != null) {
569
452
  contents.ResourceId = (0, smithy_client_1.expectString)(data.resourceId);
570
453
  }
571
- if (data.sourceArn !== undefined && data.sourceArn !== null) {
454
+ if (data.sourceArn != null) {
572
455
  contents.SourceArn = (0, smithy_client_1.expectString)(data.sourceArn);
573
456
  }
574
- if (data.sourceRoleArn !== undefined && data.sourceRoleArn !== null) {
457
+ if (data.sourceRoleArn != null) {
575
458
  contents.SourceRoleArn = (0, smithy_client_1.expectString)(data.sourceRoleArn);
576
459
  }
577
- if (data.tags !== undefined && data.tags !== null) {
460
+ if (data.tags != null) {
578
461
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
579
462
  }
580
- return Promise.resolve(contents);
463
+ return contents;
581
464
  };
582
465
  exports.deserializeAws_restJson1CreateAssetCommand = deserializeAws_restJson1CreateAssetCommand;
583
466
  const deserializeAws_restJson1CreateAssetCommandError = async (output, context) => {
@@ -585,7 +468,6 @@ const deserializeAws_restJson1CreateAssetCommandError = async (output, context)
585
468
  ...output,
586
469
  body: await parseBody(output.body, context),
587
470
  };
588
- let response;
589
471
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
590
472
  switch (errorCode) {
591
473
  case "ForbiddenException":
@@ -608,57 +490,47 @@ const deserializeAws_restJson1CreateAssetCommandError = async (output, context)
608
490
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
609
491
  default:
610
492
  const parsedBody = parsedOutput.body;
611
- const $metadata = deserializeMetadata(output);
612
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
613
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
614
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
615
- $fault: "client",
616
- $metadata,
493
+ (0, smithy_client_1.throwDefaultError)({
494
+ output,
495
+ parsedBody,
496
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
497
+ errorCode,
617
498
  });
618
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
619
499
  }
620
500
  };
621
501
  const deserializeAws_restJson1CreatePackagingConfigurationCommand = async (output, context) => {
622
502
  if (output.statusCode !== 200 && output.statusCode >= 300) {
623
503
  return deserializeAws_restJson1CreatePackagingConfigurationCommandError(output, context);
624
504
  }
625
- const contents = {
505
+ const contents = map({
626
506
  $metadata: deserializeMetadata(output),
627
- Arn: undefined,
628
- CmafPackage: undefined,
629
- DashPackage: undefined,
630
- HlsPackage: undefined,
631
- Id: undefined,
632
- MssPackage: undefined,
633
- PackagingGroupId: undefined,
634
- Tags: undefined,
635
- };
507
+ });
636
508
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
637
- if (data.arn !== undefined && data.arn !== null) {
509
+ if (data.arn != null) {
638
510
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
639
511
  }
640
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
512
+ if (data.cmafPackage != null) {
641
513
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
642
514
  }
643
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
515
+ if (data.dashPackage != null) {
644
516
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
645
517
  }
646
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
518
+ if (data.hlsPackage != null) {
647
519
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
648
520
  }
649
- if (data.id !== undefined && data.id !== null) {
521
+ if (data.id != null) {
650
522
  contents.Id = (0, smithy_client_1.expectString)(data.id);
651
523
  }
652
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
524
+ if (data.mssPackage != null) {
653
525
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
654
526
  }
655
- if (data.packagingGroupId !== undefined && data.packagingGroupId !== null) {
527
+ if (data.packagingGroupId != null) {
656
528
  contents.PackagingGroupId = (0, smithy_client_1.expectString)(data.packagingGroupId);
657
529
  }
658
- if (data.tags !== undefined && data.tags !== null) {
530
+ if (data.tags != null) {
659
531
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
660
532
  }
661
- return Promise.resolve(contents);
533
+ return contents;
662
534
  };
663
535
  exports.deserializeAws_restJson1CreatePackagingConfigurationCommand = deserializeAws_restJson1CreatePackagingConfigurationCommand;
664
536
  const deserializeAws_restJson1CreatePackagingConfigurationCommandError = async (output, context) => {
@@ -666,7 +538,6 @@ const deserializeAws_restJson1CreatePackagingConfigurationCommandError = async (
666
538
  ...output,
667
539
  body: await parseBody(output.body, context),
668
540
  };
669
- let response;
670
541
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
671
542
  switch (errorCode) {
672
543
  case "ForbiddenException":
@@ -689,49 +560,41 @@ const deserializeAws_restJson1CreatePackagingConfigurationCommandError = async (
689
560
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
690
561
  default:
691
562
  const parsedBody = parsedOutput.body;
692
- const $metadata = deserializeMetadata(output);
693
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
694
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
695
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
696
- $fault: "client",
697
- $metadata,
563
+ (0, smithy_client_1.throwDefaultError)({
564
+ output,
565
+ parsedBody,
566
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
567
+ errorCode,
698
568
  });
699
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
700
569
  }
701
570
  };
702
571
  const deserializeAws_restJson1CreatePackagingGroupCommand = async (output, context) => {
703
572
  if (output.statusCode !== 200 && output.statusCode >= 300) {
704
573
  return deserializeAws_restJson1CreatePackagingGroupCommandError(output, context);
705
574
  }
706
- const contents = {
575
+ const contents = map({
707
576
  $metadata: deserializeMetadata(output),
708
- Arn: undefined,
709
- Authorization: undefined,
710
- DomainName: undefined,
711
- EgressAccessLogs: undefined,
712
- Id: undefined,
713
- Tags: undefined,
714
- };
577
+ });
715
578
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
716
- if (data.arn !== undefined && data.arn !== null) {
579
+ if (data.arn != null) {
717
580
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
718
581
  }
719
- if (data.authorization !== undefined && data.authorization !== null) {
582
+ if (data.authorization != null) {
720
583
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
721
584
  }
722
- if (data.domainName !== undefined && data.domainName !== null) {
585
+ if (data.domainName != null) {
723
586
  contents.DomainName = (0, smithy_client_1.expectString)(data.domainName);
724
587
  }
725
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
588
+ if (data.egressAccessLogs != null) {
726
589
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
727
590
  }
728
- if (data.id !== undefined && data.id !== null) {
591
+ if (data.id != null) {
729
592
  contents.Id = (0, smithy_client_1.expectString)(data.id);
730
593
  }
731
- if (data.tags !== undefined && data.tags !== null) {
594
+ if (data.tags != null) {
732
595
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
733
596
  }
734
- return Promise.resolve(contents);
597
+ return contents;
735
598
  };
736
599
  exports.deserializeAws_restJson1CreatePackagingGroupCommand = deserializeAws_restJson1CreatePackagingGroupCommand;
737
600
  const deserializeAws_restJson1CreatePackagingGroupCommandError = async (output, context) => {
@@ -739,7 +602,6 @@ const deserializeAws_restJson1CreatePackagingGroupCommandError = async (output,
739
602
  ...output,
740
603
  body: await parseBody(output.body, context),
741
604
  };
742
- let response;
743
605
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
744
606
  switch (errorCode) {
745
607
  case "ForbiddenException":
@@ -762,25 +624,23 @@ const deserializeAws_restJson1CreatePackagingGroupCommandError = async (output,
762
624
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
763
625
  default:
764
626
  const parsedBody = parsedOutput.body;
765
- const $metadata = deserializeMetadata(output);
766
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
767
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
768
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
769
- $fault: "client",
770
- $metadata,
627
+ (0, smithy_client_1.throwDefaultError)({
628
+ output,
629
+ parsedBody,
630
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
631
+ errorCode,
771
632
  });
772
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
773
633
  }
774
634
  };
775
635
  const deserializeAws_restJson1DeleteAssetCommand = async (output, context) => {
776
636
  if (output.statusCode !== 202 && output.statusCode >= 300) {
777
637
  return deserializeAws_restJson1DeleteAssetCommandError(output, context);
778
638
  }
779
- const contents = {
639
+ const contents = map({
780
640
  $metadata: deserializeMetadata(output),
781
- };
641
+ });
782
642
  await collectBody(output.body, context);
783
- return Promise.resolve(contents);
643
+ return contents;
784
644
  };
785
645
  exports.deserializeAws_restJson1DeleteAssetCommand = deserializeAws_restJson1DeleteAssetCommand;
786
646
  const deserializeAws_restJson1DeleteAssetCommandError = async (output, context) => {
@@ -788,7 +648,6 @@ const deserializeAws_restJson1DeleteAssetCommandError = async (output, context)
788
648
  ...output,
789
649
  body: await parseBody(output.body, context),
790
650
  };
791
- let response;
792
651
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
793
652
  switch (errorCode) {
794
653
  case "ForbiddenException":
@@ -811,25 +670,23 @@ const deserializeAws_restJson1DeleteAssetCommandError = async (output, context)
811
670
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
812
671
  default:
813
672
  const parsedBody = parsedOutput.body;
814
- const $metadata = deserializeMetadata(output);
815
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
816
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
817
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
818
- $fault: "client",
819
- $metadata,
673
+ (0, smithy_client_1.throwDefaultError)({
674
+ output,
675
+ parsedBody,
676
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
677
+ errorCode,
820
678
  });
821
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
822
679
  }
823
680
  };
824
681
  const deserializeAws_restJson1DeletePackagingConfigurationCommand = async (output, context) => {
825
682
  if (output.statusCode !== 202 && output.statusCode >= 300) {
826
683
  return deserializeAws_restJson1DeletePackagingConfigurationCommandError(output, context);
827
684
  }
828
- const contents = {
685
+ const contents = map({
829
686
  $metadata: deserializeMetadata(output),
830
- };
687
+ });
831
688
  await collectBody(output.body, context);
832
- return Promise.resolve(contents);
689
+ return contents;
833
690
  };
834
691
  exports.deserializeAws_restJson1DeletePackagingConfigurationCommand = deserializeAws_restJson1DeletePackagingConfigurationCommand;
835
692
  const deserializeAws_restJson1DeletePackagingConfigurationCommandError = async (output, context) => {
@@ -837,7 +694,6 @@ const deserializeAws_restJson1DeletePackagingConfigurationCommandError = async (
837
694
  ...output,
838
695
  body: await parseBody(output.body, context),
839
696
  };
840
- let response;
841
697
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
842
698
  switch (errorCode) {
843
699
  case "ForbiddenException":
@@ -860,25 +716,23 @@ const deserializeAws_restJson1DeletePackagingConfigurationCommandError = async (
860
716
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
861
717
  default:
862
718
  const parsedBody = parsedOutput.body;
863
- const $metadata = deserializeMetadata(output);
864
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
865
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
866
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
867
- $fault: "client",
868
- $metadata,
719
+ (0, smithy_client_1.throwDefaultError)({
720
+ output,
721
+ parsedBody,
722
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
723
+ errorCode,
869
724
  });
870
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
871
725
  }
872
726
  };
873
727
  const deserializeAws_restJson1DeletePackagingGroupCommand = async (output, context) => {
874
728
  if (output.statusCode !== 202 && output.statusCode >= 300) {
875
729
  return deserializeAws_restJson1DeletePackagingGroupCommandError(output, context);
876
730
  }
877
- const contents = {
731
+ const contents = map({
878
732
  $metadata: deserializeMetadata(output),
879
- };
733
+ });
880
734
  await collectBody(output.body, context);
881
- return Promise.resolve(contents);
735
+ return contents;
882
736
  };
883
737
  exports.deserializeAws_restJson1DeletePackagingGroupCommand = deserializeAws_restJson1DeletePackagingGroupCommand;
884
738
  const deserializeAws_restJson1DeletePackagingGroupCommandError = async (output, context) => {
@@ -886,7 +740,6 @@ const deserializeAws_restJson1DeletePackagingGroupCommandError = async (output,
886
740
  ...output,
887
741
  body: await parseBody(output.body, context),
888
742
  };
889
- let response;
890
743
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
891
744
  switch (errorCode) {
892
745
  case "ForbiddenException":
@@ -909,61 +762,50 @@ const deserializeAws_restJson1DeletePackagingGroupCommandError = async (output,
909
762
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
910
763
  default:
911
764
  const parsedBody = parsedOutput.body;
912
- const $metadata = deserializeMetadata(output);
913
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
914
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
915
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
916
- $fault: "client",
917
- $metadata,
765
+ (0, smithy_client_1.throwDefaultError)({
766
+ output,
767
+ parsedBody,
768
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
769
+ errorCode,
918
770
  });
919
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
920
771
  }
921
772
  };
922
773
  const deserializeAws_restJson1DescribeAssetCommand = async (output, context) => {
923
774
  if (output.statusCode !== 200 && output.statusCode >= 300) {
924
775
  return deserializeAws_restJson1DescribeAssetCommandError(output, context);
925
776
  }
926
- const contents = {
777
+ const contents = map({
927
778
  $metadata: deserializeMetadata(output),
928
- Arn: undefined,
929
- CreatedAt: undefined,
930
- EgressEndpoints: undefined,
931
- Id: undefined,
932
- PackagingGroupId: undefined,
933
- ResourceId: undefined,
934
- SourceArn: undefined,
935
- SourceRoleArn: undefined,
936
- Tags: undefined,
937
- };
779
+ });
938
780
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
939
- if (data.arn !== undefined && data.arn !== null) {
781
+ if (data.arn != null) {
940
782
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
941
783
  }
942
- if (data.createdAt !== undefined && data.createdAt !== null) {
784
+ if (data.createdAt != null) {
943
785
  contents.CreatedAt = (0, smithy_client_1.expectString)(data.createdAt);
944
786
  }
945
- if (data.egressEndpoints !== undefined && data.egressEndpoints !== null) {
787
+ if (data.egressEndpoints != null) {
946
788
  contents.EgressEndpoints = deserializeAws_restJson1__listOfEgressEndpoint(data.egressEndpoints, context);
947
789
  }
948
- if (data.id !== undefined && data.id !== null) {
790
+ if (data.id != null) {
949
791
  contents.Id = (0, smithy_client_1.expectString)(data.id);
950
792
  }
951
- if (data.packagingGroupId !== undefined && data.packagingGroupId !== null) {
793
+ if (data.packagingGroupId != null) {
952
794
  contents.PackagingGroupId = (0, smithy_client_1.expectString)(data.packagingGroupId);
953
795
  }
954
- if (data.resourceId !== undefined && data.resourceId !== null) {
796
+ if (data.resourceId != null) {
955
797
  contents.ResourceId = (0, smithy_client_1.expectString)(data.resourceId);
956
798
  }
957
- if (data.sourceArn !== undefined && data.sourceArn !== null) {
799
+ if (data.sourceArn != null) {
958
800
  contents.SourceArn = (0, smithy_client_1.expectString)(data.sourceArn);
959
801
  }
960
- if (data.sourceRoleArn !== undefined && data.sourceRoleArn !== null) {
802
+ if (data.sourceRoleArn != null) {
961
803
  contents.SourceRoleArn = (0, smithy_client_1.expectString)(data.sourceRoleArn);
962
804
  }
963
- if (data.tags !== undefined && data.tags !== null) {
805
+ if (data.tags != null) {
964
806
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
965
807
  }
966
- return Promise.resolve(contents);
808
+ return contents;
967
809
  };
968
810
  exports.deserializeAws_restJson1DescribeAssetCommand = deserializeAws_restJson1DescribeAssetCommand;
969
811
  const deserializeAws_restJson1DescribeAssetCommandError = async (output, context) => {
@@ -971,7 +813,6 @@ const deserializeAws_restJson1DescribeAssetCommandError = async (output, context
971
813
  ...output,
972
814
  body: await parseBody(output.body, context),
973
815
  };
974
- let response;
975
816
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
976
817
  switch (errorCode) {
977
818
  case "ForbiddenException":
@@ -994,57 +835,47 @@ const deserializeAws_restJson1DescribeAssetCommandError = async (output, context
994
835
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
995
836
  default:
996
837
  const parsedBody = parsedOutput.body;
997
- const $metadata = deserializeMetadata(output);
998
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
999
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1000
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1001
- $fault: "client",
1002
- $metadata,
838
+ (0, smithy_client_1.throwDefaultError)({
839
+ output,
840
+ parsedBody,
841
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
842
+ errorCode,
1003
843
  });
1004
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1005
844
  }
1006
845
  };
1007
846
  const deserializeAws_restJson1DescribePackagingConfigurationCommand = async (output, context) => {
1008
847
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1009
848
  return deserializeAws_restJson1DescribePackagingConfigurationCommandError(output, context);
1010
849
  }
1011
- const contents = {
850
+ const contents = map({
1012
851
  $metadata: deserializeMetadata(output),
1013
- Arn: undefined,
1014
- CmafPackage: undefined,
1015
- DashPackage: undefined,
1016
- HlsPackage: undefined,
1017
- Id: undefined,
1018
- MssPackage: undefined,
1019
- PackagingGroupId: undefined,
1020
- Tags: undefined,
1021
- };
852
+ });
1022
853
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1023
- if (data.arn !== undefined && data.arn !== null) {
854
+ if (data.arn != null) {
1024
855
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1025
856
  }
1026
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
857
+ if (data.cmafPackage != null) {
1027
858
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
1028
859
  }
1029
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
860
+ if (data.dashPackage != null) {
1030
861
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
1031
862
  }
1032
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
863
+ if (data.hlsPackage != null) {
1033
864
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
1034
865
  }
1035
- if (data.id !== undefined && data.id !== null) {
866
+ if (data.id != null) {
1036
867
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1037
868
  }
1038
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
869
+ if (data.mssPackage != null) {
1039
870
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
1040
871
  }
1041
- if (data.packagingGroupId !== undefined && data.packagingGroupId !== null) {
872
+ if (data.packagingGroupId != null) {
1042
873
  contents.PackagingGroupId = (0, smithy_client_1.expectString)(data.packagingGroupId);
1043
874
  }
1044
- if (data.tags !== undefined && data.tags !== null) {
875
+ if (data.tags != null) {
1045
876
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1046
877
  }
1047
- return Promise.resolve(contents);
878
+ return contents;
1048
879
  };
1049
880
  exports.deserializeAws_restJson1DescribePackagingConfigurationCommand = deserializeAws_restJson1DescribePackagingConfigurationCommand;
1050
881
  const deserializeAws_restJson1DescribePackagingConfigurationCommandError = async (output, context) => {
@@ -1052,7 +883,6 @@ const deserializeAws_restJson1DescribePackagingConfigurationCommandError = async
1052
883
  ...output,
1053
884
  body: await parseBody(output.body, context),
1054
885
  };
1055
- let response;
1056
886
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1057
887
  switch (errorCode) {
1058
888
  case "ForbiddenException":
@@ -1075,49 +905,41 @@ const deserializeAws_restJson1DescribePackagingConfigurationCommandError = async
1075
905
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1076
906
  default:
1077
907
  const parsedBody = parsedOutput.body;
1078
- const $metadata = deserializeMetadata(output);
1079
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1080
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1081
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1082
- $fault: "client",
1083
- $metadata,
908
+ (0, smithy_client_1.throwDefaultError)({
909
+ output,
910
+ parsedBody,
911
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
912
+ errorCode,
1084
913
  });
1085
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1086
914
  }
1087
915
  };
1088
916
  const deserializeAws_restJson1DescribePackagingGroupCommand = async (output, context) => {
1089
917
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1090
918
  return deserializeAws_restJson1DescribePackagingGroupCommandError(output, context);
1091
919
  }
1092
- const contents = {
920
+ const contents = map({
1093
921
  $metadata: deserializeMetadata(output),
1094
- Arn: undefined,
1095
- Authorization: undefined,
1096
- DomainName: undefined,
1097
- EgressAccessLogs: undefined,
1098
- Id: undefined,
1099
- Tags: undefined,
1100
- };
922
+ });
1101
923
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1102
- if (data.arn !== undefined && data.arn !== null) {
924
+ if (data.arn != null) {
1103
925
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1104
926
  }
1105
- if (data.authorization !== undefined && data.authorization !== null) {
927
+ if (data.authorization != null) {
1106
928
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1107
929
  }
1108
- if (data.domainName !== undefined && data.domainName !== null) {
930
+ if (data.domainName != null) {
1109
931
  contents.DomainName = (0, smithy_client_1.expectString)(data.domainName);
1110
932
  }
1111
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
933
+ if (data.egressAccessLogs != null) {
1112
934
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1113
935
  }
1114
- if (data.id !== undefined && data.id !== null) {
936
+ if (data.id != null) {
1115
937
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1116
938
  }
1117
- if (data.tags !== undefined && data.tags !== null) {
939
+ if (data.tags != null) {
1118
940
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1119
941
  }
1120
- return Promise.resolve(contents);
942
+ return contents;
1121
943
  };
1122
944
  exports.deserializeAws_restJson1DescribePackagingGroupCommand = deserializeAws_restJson1DescribePackagingGroupCommand;
1123
945
  const deserializeAws_restJson1DescribePackagingGroupCommandError = async (output, context) => {
@@ -1125,7 +947,6 @@ const deserializeAws_restJson1DescribePackagingGroupCommandError = async (output
1125
947
  ...output,
1126
948
  body: await parseBody(output.body, context),
1127
949
  };
1128
- let response;
1129
950
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1130
951
  switch (errorCode) {
1131
952
  case "ForbiddenException":
@@ -1148,33 +969,29 @@ const deserializeAws_restJson1DescribePackagingGroupCommandError = async (output
1148
969
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1149
970
  default:
1150
971
  const parsedBody = parsedOutput.body;
1151
- const $metadata = deserializeMetadata(output);
1152
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1153
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1154
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1155
- $fault: "client",
1156
- $metadata,
972
+ (0, smithy_client_1.throwDefaultError)({
973
+ output,
974
+ parsedBody,
975
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
976
+ errorCode,
1157
977
  });
1158
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1159
978
  }
1160
979
  };
1161
980
  const deserializeAws_restJson1ListAssetsCommand = async (output, context) => {
1162
981
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1163
982
  return deserializeAws_restJson1ListAssetsCommandError(output, context);
1164
983
  }
1165
- const contents = {
984
+ const contents = map({
1166
985
  $metadata: deserializeMetadata(output),
1167
- Assets: undefined,
1168
- NextToken: undefined,
1169
- };
986
+ });
1170
987
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1171
- if (data.assets !== undefined && data.assets !== null) {
988
+ if (data.assets != null) {
1172
989
  contents.Assets = deserializeAws_restJson1__listOfAssetShallow(data.assets, context);
1173
990
  }
1174
- if (data.nextToken !== undefined && data.nextToken !== null) {
991
+ if (data.nextToken != null) {
1175
992
  contents.NextToken = (0, smithy_client_1.expectString)(data.nextToken);
1176
993
  }
1177
- return Promise.resolve(contents);
994
+ return contents;
1178
995
  };
1179
996
  exports.deserializeAws_restJson1ListAssetsCommand = deserializeAws_restJson1ListAssetsCommand;
1180
997
  const deserializeAws_restJson1ListAssetsCommandError = async (output, context) => {
@@ -1182,7 +999,6 @@ const deserializeAws_restJson1ListAssetsCommandError = async (output, context) =
1182
999
  ...output,
1183
1000
  body: await parseBody(output.body, context),
1184
1001
  };
1185
- let response;
1186
1002
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1187
1003
  switch (errorCode) {
1188
1004
  case "ForbiddenException":
@@ -1205,33 +1021,29 @@ const deserializeAws_restJson1ListAssetsCommandError = async (output, context) =
1205
1021
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1206
1022
  default:
1207
1023
  const parsedBody = parsedOutput.body;
1208
- const $metadata = deserializeMetadata(output);
1209
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1210
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1211
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1212
- $fault: "client",
1213
- $metadata,
1024
+ (0, smithy_client_1.throwDefaultError)({
1025
+ output,
1026
+ parsedBody,
1027
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1028
+ errorCode,
1214
1029
  });
1215
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1216
1030
  }
1217
1031
  };
1218
1032
  const deserializeAws_restJson1ListPackagingConfigurationsCommand = async (output, context) => {
1219
1033
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1220
1034
  return deserializeAws_restJson1ListPackagingConfigurationsCommandError(output, context);
1221
1035
  }
1222
- const contents = {
1036
+ const contents = map({
1223
1037
  $metadata: deserializeMetadata(output),
1224
- NextToken: undefined,
1225
- PackagingConfigurations: undefined,
1226
- };
1038
+ });
1227
1039
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1228
- if (data.nextToken !== undefined && data.nextToken !== null) {
1040
+ if (data.nextToken != null) {
1229
1041
  contents.NextToken = (0, smithy_client_1.expectString)(data.nextToken);
1230
1042
  }
1231
- if (data.packagingConfigurations !== undefined && data.packagingConfigurations !== null) {
1043
+ if (data.packagingConfigurations != null) {
1232
1044
  contents.PackagingConfigurations = deserializeAws_restJson1__listOfPackagingConfiguration(data.packagingConfigurations, context);
1233
1045
  }
1234
- return Promise.resolve(contents);
1046
+ return contents;
1235
1047
  };
1236
1048
  exports.deserializeAws_restJson1ListPackagingConfigurationsCommand = deserializeAws_restJson1ListPackagingConfigurationsCommand;
1237
1049
  const deserializeAws_restJson1ListPackagingConfigurationsCommandError = async (output, context) => {
@@ -1239,7 +1051,6 @@ const deserializeAws_restJson1ListPackagingConfigurationsCommandError = async (o
1239
1051
  ...output,
1240
1052
  body: await parseBody(output.body, context),
1241
1053
  };
1242
- let response;
1243
1054
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1244
1055
  switch (errorCode) {
1245
1056
  case "ForbiddenException":
@@ -1262,33 +1073,29 @@ const deserializeAws_restJson1ListPackagingConfigurationsCommandError = async (o
1262
1073
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1263
1074
  default:
1264
1075
  const parsedBody = parsedOutput.body;
1265
- const $metadata = deserializeMetadata(output);
1266
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1267
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1268
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1269
- $fault: "client",
1270
- $metadata,
1076
+ (0, smithy_client_1.throwDefaultError)({
1077
+ output,
1078
+ parsedBody,
1079
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1080
+ errorCode,
1271
1081
  });
1272
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1273
1082
  }
1274
1083
  };
1275
1084
  const deserializeAws_restJson1ListPackagingGroupsCommand = async (output, context) => {
1276
1085
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1277
1086
  return deserializeAws_restJson1ListPackagingGroupsCommandError(output, context);
1278
1087
  }
1279
- const contents = {
1088
+ const contents = map({
1280
1089
  $metadata: deserializeMetadata(output),
1281
- NextToken: undefined,
1282
- PackagingGroups: undefined,
1283
- };
1090
+ });
1284
1091
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1285
- if (data.nextToken !== undefined && data.nextToken !== null) {
1092
+ if (data.nextToken != null) {
1286
1093
  contents.NextToken = (0, smithy_client_1.expectString)(data.nextToken);
1287
1094
  }
1288
- if (data.packagingGroups !== undefined && data.packagingGroups !== null) {
1095
+ if (data.packagingGroups != null) {
1289
1096
  contents.PackagingGroups = deserializeAws_restJson1__listOfPackagingGroup(data.packagingGroups, context);
1290
1097
  }
1291
- return Promise.resolve(contents);
1098
+ return contents;
1292
1099
  };
1293
1100
  exports.deserializeAws_restJson1ListPackagingGroupsCommand = deserializeAws_restJson1ListPackagingGroupsCommand;
1294
1101
  const deserializeAws_restJson1ListPackagingGroupsCommandError = async (output, context) => {
@@ -1296,7 +1103,6 @@ const deserializeAws_restJson1ListPackagingGroupsCommandError = async (output, c
1296
1103
  ...output,
1297
1104
  body: await parseBody(output.body, context),
1298
1105
  };
1299
- let response;
1300
1106
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1301
1107
  switch (errorCode) {
1302
1108
  case "ForbiddenException":
@@ -1319,29 +1125,26 @@ const deserializeAws_restJson1ListPackagingGroupsCommandError = async (output, c
1319
1125
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1320
1126
  default:
1321
1127
  const parsedBody = parsedOutput.body;
1322
- const $metadata = deserializeMetadata(output);
1323
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1324
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1325
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1326
- $fault: "client",
1327
- $metadata,
1128
+ (0, smithy_client_1.throwDefaultError)({
1129
+ output,
1130
+ parsedBody,
1131
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1132
+ errorCode,
1328
1133
  });
1329
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1330
1134
  }
1331
1135
  };
1332
1136
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1333
1137
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1334
1138
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1335
1139
  }
1336
- const contents = {
1140
+ const contents = map({
1337
1141
  $metadata: deserializeMetadata(output),
1338
- Tags: undefined,
1339
- };
1142
+ });
1340
1143
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1341
- if (data.tags !== undefined && data.tags !== null) {
1144
+ if (data.tags != null) {
1342
1145
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1343
1146
  }
1344
- return Promise.resolve(contents);
1147
+ return contents;
1345
1148
  };
1346
1149
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1347
1150
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1349,30 +1152,24 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1349
1152
  ...output,
1350
1153
  body: await parseBody(output.body, context),
1351
1154
  };
1352
- let response;
1353
1155
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1354
- switch (errorCode) {
1355
- default:
1356
- const parsedBody = parsedOutput.body;
1357
- const $metadata = deserializeMetadata(output);
1358
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1359
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1360
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1361
- $fault: "client",
1362
- $metadata,
1363
- });
1364
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1365
- }
1156
+ const parsedBody = parsedOutput.body;
1157
+ (0, smithy_client_1.throwDefaultError)({
1158
+ output,
1159
+ parsedBody,
1160
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1161
+ errorCode,
1162
+ });
1366
1163
  };
1367
1164
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1368
1165
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1369
1166
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1370
1167
  }
1371
- const contents = {
1168
+ const contents = map({
1372
1169
  $metadata: deserializeMetadata(output),
1373
- };
1170
+ });
1374
1171
  await collectBody(output.body, context);
1375
- return Promise.resolve(contents);
1172
+ return contents;
1376
1173
  };
1377
1174
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1378
1175
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1380,30 +1177,24 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1380
1177
  ...output,
1381
1178
  body: await parseBody(output.body, context),
1382
1179
  };
1383
- let response;
1384
1180
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1385
- switch (errorCode) {
1386
- default:
1387
- const parsedBody = parsedOutput.body;
1388
- const $metadata = deserializeMetadata(output);
1389
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1390
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1391
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1392
- $fault: "client",
1393
- $metadata,
1394
- });
1395
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1396
- }
1181
+ const parsedBody = parsedOutput.body;
1182
+ (0, smithy_client_1.throwDefaultError)({
1183
+ output,
1184
+ parsedBody,
1185
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1186
+ errorCode,
1187
+ });
1397
1188
  };
1398
1189
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1399
1190
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1400
1191
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1401
1192
  }
1402
- const contents = {
1193
+ const contents = map({
1403
1194
  $metadata: deserializeMetadata(output),
1404
- };
1195
+ });
1405
1196
  await collectBody(output.body, context);
1406
- return Promise.resolve(contents);
1197
+ return contents;
1407
1198
  };
1408
1199
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1409
1200
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1411,54 +1202,42 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1411
1202
  ...output,
1412
1203
  body: await parseBody(output.body, context),
1413
1204
  };
1414
- let response;
1415
1205
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1416
- switch (errorCode) {
1417
- default:
1418
- const parsedBody = parsedOutput.body;
1419
- const $metadata = deserializeMetadata(output);
1420
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1421
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1422
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1423
- $fault: "client",
1424
- $metadata,
1425
- });
1426
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1427
- }
1206
+ const parsedBody = parsedOutput.body;
1207
+ (0, smithy_client_1.throwDefaultError)({
1208
+ output,
1209
+ parsedBody,
1210
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1211
+ errorCode,
1212
+ });
1428
1213
  };
1429
1214
  const deserializeAws_restJson1UpdatePackagingGroupCommand = async (output, context) => {
1430
1215
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1431
1216
  return deserializeAws_restJson1UpdatePackagingGroupCommandError(output, context);
1432
1217
  }
1433
- const contents = {
1218
+ const contents = map({
1434
1219
  $metadata: deserializeMetadata(output),
1435
- Arn: undefined,
1436
- Authorization: undefined,
1437
- DomainName: undefined,
1438
- EgressAccessLogs: undefined,
1439
- Id: undefined,
1440
- Tags: undefined,
1441
- };
1220
+ });
1442
1221
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1443
- if (data.arn !== undefined && data.arn !== null) {
1222
+ if (data.arn != null) {
1444
1223
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1445
1224
  }
1446
- if (data.authorization !== undefined && data.authorization !== null) {
1225
+ if (data.authorization != null) {
1447
1226
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1448
1227
  }
1449
- if (data.domainName !== undefined && data.domainName !== null) {
1228
+ if (data.domainName != null) {
1450
1229
  contents.DomainName = (0, smithy_client_1.expectString)(data.domainName);
1451
1230
  }
1452
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1231
+ if (data.egressAccessLogs != null) {
1453
1232
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1454
1233
  }
1455
- if (data.id !== undefined && data.id !== null) {
1234
+ if (data.id != null) {
1456
1235
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1457
1236
  }
1458
- if (data.tags !== undefined && data.tags !== null) {
1237
+ if (data.tags != null) {
1459
1238
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1460
1239
  }
1461
- return Promise.resolve(contents);
1240
+ return contents;
1462
1241
  };
1463
1242
  exports.deserializeAws_restJson1UpdatePackagingGroupCommand = deserializeAws_restJson1UpdatePackagingGroupCommand;
1464
1243
  const deserializeAws_restJson1UpdatePackagingGroupCommandError = async (output, context) => {
@@ -1466,7 +1245,6 @@ const deserializeAws_restJson1UpdatePackagingGroupCommandError = async (output,
1466
1245
  ...output,
1467
1246
  body: await parseBody(output.body, context),
1468
1247
  };
1469
- let response;
1470
1248
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1471
1249
  switch (errorCode) {
1472
1250
  case "ForbiddenException":
@@ -1489,20 +1267,19 @@ const deserializeAws_restJson1UpdatePackagingGroupCommandError = async (output,
1489
1267
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1490
1268
  default:
1491
1269
  const parsedBody = parsedOutput.body;
1492
- const $metadata = deserializeMetadata(output);
1493
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1494
- response = new MediaPackageVodServiceException_1.MediaPackageVodServiceException({
1495
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1496
- $fault: "client",
1497
- $metadata,
1270
+ (0, smithy_client_1.throwDefaultError)({
1271
+ output,
1272
+ parsedBody,
1273
+ exceptionCtor: MediaPackageVodServiceException_1.MediaPackageVodServiceException,
1274
+ errorCode,
1498
1275
  });
1499
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1500
1276
  }
1501
1277
  };
1278
+ const map = smithy_client_1.map;
1502
1279
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1503
- const contents = {};
1280
+ const contents = map({});
1504
1281
  const data = parsedOutput.body;
1505
- if (data.message !== undefined && data.message !== null) {
1282
+ if (data.message != null) {
1506
1283
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1507
1284
  }
1508
1285
  const exception = new models_0_1.ForbiddenException({
@@ -1512,9 +1289,9 @@ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput,
1512
1289
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1513
1290
  };
1514
1291
  const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
1515
- const contents = {};
1292
+ const contents = map({});
1516
1293
  const data = parsedOutput.body;
1517
- if (data.message !== undefined && data.message !== null) {
1294
+ if (data.message != null) {
1518
1295
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1519
1296
  }
1520
1297
  const exception = new models_0_1.InternalServerErrorException({
@@ -1524,9 +1301,9 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (pars
1524
1301
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1525
1302
  };
1526
1303
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1527
- const contents = {};
1304
+ const contents = map({});
1528
1305
  const data = parsedOutput.body;
1529
- if (data.message !== undefined && data.message !== null) {
1306
+ if (data.message != null) {
1530
1307
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1531
1308
  }
1532
1309
  const exception = new models_0_1.NotFoundException({
@@ -1536,9 +1313,9 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
1536
1313
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1537
1314
  };
1538
1315
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
1539
- const contents = {};
1316
+ const contents = map({});
1540
1317
  const data = parsedOutput.body;
1541
- if (data.message !== undefined && data.message !== null) {
1318
+ if (data.message != null) {
1542
1319
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1543
1320
  }
1544
1321
  const exception = new models_0_1.ServiceUnavailableException({
@@ -1548,9 +1325,9 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
1548
1325
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1549
1326
  };
1550
1327
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1551
- const contents = {};
1328
+ const contents = map({});
1552
1329
  const data = parsedOutput.body;
1553
- if (data.message !== undefined && data.message !== null) {
1330
+ if (data.message != null) {
1554
1331
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1555
1332
  }
1556
1333
  const exception = new models_0_1.TooManyRequestsException({
@@ -1560,9 +1337,9 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
1560
1337
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1561
1338
  };
1562
1339
  const deserializeAws_restJson1UnprocessableEntityExceptionResponse = async (parsedOutput, context) => {
1563
- const contents = {};
1340
+ const contents = map({});
1564
1341
  const data = parsedOutput.body;
1565
- if (data.message !== undefined && data.message !== null) {
1342
+ if (data.message != null) {
1566
1343
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1567
1344
  }
1568
1345
  const exception = new models_0_1.UnprocessableEntityException({
@@ -1575,9 +1352,6 @@ const serializeAws_restJson1__listOf__PeriodTriggersElement = (input, context) =
1575
1352
  return input
1576
1353
  .filter((e) => e != null)
1577
1354
  .map((entry) => {
1578
- if (entry === null) {
1579
- return null;
1580
- }
1581
1355
  return entry;
1582
1356
  });
1583
1357
  };
@@ -1585,9 +1359,6 @@ const serializeAws_restJson1__listOf__string = (input, context) => {
1585
1359
  return input
1586
1360
  .filter((e) => e != null)
1587
1361
  .map((entry) => {
1588
- if (entry === null) {
1589
- return null;
1590
- }
1591
1362
  return entry;
1592
1363
  });
1593
1364
  };
@@ -1595,9 +1366,6 @@ const serializeAws_restJson1__listOfDashManifest = (input, context) => {
1595
1366
  return input
1596
1367
  .filter((e) => e != null)
1597
1368
  .map((entry) => {
1598
- if (entry === null) {
1599
- return null;
1600
- }
1601
1369
  return serializeAws_restJson1DashManifest(entry, context);
1602
1370
  });
1603
1371
  };
@@ -1605,9 +1373,6 @@ const serializeAws_restJson1__listOfHlsManifest = (input, context) => {
1605
1373
  return input
1606
1374
  .filter((e) => e != null)
1607
1375
  .map((entry) => {
1608
- if (entry === null) {
1609
- return null;
1610
- }
1611
1376
  return serializeAws_restJson1HlsManifest(entry, context);
1612
1377
  });
1613
1378
  };
@@ -1615,9 +1380,6 @@ const serializeAws_restJson1__listOfMssManifest = (input, context) => {
1615
1380
  return input
1616
1381
  .filter((e) => e != null)
1617
1382
  .map((entry) => {
1618
- if (entry === null) {
1619
- return null;
1620
- }
1621
1383
  return serializeAws_restJson1MssManifest(entry, context);
1622
1384
  });
1623
1385
  };