@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.
@@ -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 || ""}` + "/channels/{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 && {
@@ -133,16 +124,7 @@ const serializeAws_restJson1DeleteChannelCommand = async (input, context) => {
133
124
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
134
125
  const headers = {};
135
126
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{Id}";
136
- if (input.Id !== undefined) {
137
- const labelValue = input.Id;
138
- if (labelValue.length <= 0) {
139
- throw new Error("Empty value provided for input HTTP label: Id.");
140
- }
141
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
142
- }
143
- else {
144
- throw new Error("No value provided for input HTTP label: Id.");
145
- }
127
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
146
128
  let body;
147
129
  return new protocol_http_1.HttpRequest({
148
130
  protocol,
@@ -159,16 +141,7 @@ const serializeAws_restJson1DeleteOriginEndpointCommand = async (input, context)
159
141
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
160
142
  const headers = {};
161
143
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/origin_endpoints/{Id}";
162
- if (input.Id !== undefined) {
163
- const 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}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
168
- }
169
- else {
170
- throw new Error("No value provided for input HTTP label: Id.");
171
- }
144
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
172
145
  let body;
173
146
  return new protocol_http_1.HttpRequest({
174
147
  protocol,
@@ -185,16 +158,7 @@ const serializeAws_restJson1DescribeChannelCommand = async (input, context) => {
185
158
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
186
159
  const headers = {};
187
160
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{Id}";
188
- if (input.Id !== undefined) {
189
- const labelValue = input.Id;
190
- if (labelValue.length <= 0) {
191
- throw new Error("Empty value provided for input HTTP label: Id.");
192
- }
193
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
194
- }
195
- else {
196
- throw new Error("No value provided for input HTTP label: Id.");
197
- }
161
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
198
162
  let body;
199
163
  return new protocol_http_1.HttpRequest({
200
164
  protocol,
@@ -211,16 +175,7 @@ const serializeAws_restJson1DescribeHarvestJobCommand = async (input, context) =
211
175
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
212
176
  const headers = {};
213
177
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/harvest_jobs/{Id}";
214
- if (input.Id !== undefined) {
215
- const labelValue = input.Id;
216
- if (labelValue.length <= 0) {
217
- throw new Error("Empty value provided for input HTTP label: Id.");
218
- }
219
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
220
- }
221
- else {
222
- throw new Error("No value provided for input HTTP label: Id.");
223
- }
178
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
224
179
  let body;
225
180
  return new protocol_http_1.HttpRequest({
226
181
  protocol,
@@ -237,16 +192,7 @@ const serializeAws_restJson1DescribeOriginEndpointCommand = async (input, contex
237
192
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
238
193
  const headers = {};
239
194
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/origin_endpoints/{Id}";
240
- if (input.Id !== undefined) {
241
- const labelValue = input.Id;
242
- if (labelValue.length <= 0) {
243
- throw new Error("Empty value provided for input HTTP label: Id.");
244
- }
245
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
246
- }
247
- else {
248
- throw new Error("No value provided for input HTTP label: Id.");
249
- }
195
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
250
196
  let body;
251
197
  return new protocol_http_1.HttpRequest({
252
198
  protocol,
@@ -263,10 +209,10 @@ const serializeAws_restJson1ListChannelsCommand = async (input, context) => {
263
209
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
264
210
  const headers = {};
265
211
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/channels";
266
- const query = {
267
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
268
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
269
- };
212
+ const query = map({
213
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
214
+ nextToken: [, input.NextToken],
215
+ });
270
216
  let body;
271
217
  return new protocol_http_1.HttpRequest({
272
218
  protocol,
@@ -284,12 +230,12 @@ const serializeAws_restJson1ListHarvestJobsCommand = async (input, context) => {
284
230
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
285
231
  const headers = {};
286
232
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/harvest_jobs";
287
- const query = {
288
- ...(input.IncludeChannelId !== undefined && { includeChannelId: input.IncludeChannelId }),
289
- ...(input.IncludeStatus !== undefined && { includeStatus: input.IncludeStatus }),
290
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
291
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
292
- };
233
+ const query = map({
234
+ includeChannelId: [, input.IncludeChannelId],
235
+ includeStatus: [, input.IncludeStatus],
236
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
237
+ nextToken: [, input.NextToken],
238
+ });
293
239
  let body;
294
240
  return new protocol_http_1.HttpRequest({
295
241
  protocol,
@@ -307,11 +253,11 @@ const serializeAws_restJson1ListOriginEndpointsCommand = async (input, context)
307
253
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
308
254
  const headers = {};
309
255
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/origin_endpoints";
310
- const query = {
311
- ...(input.ChannelId !== undefined && { channelId: input.ChannelId }),
312
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
313
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
314
- };
256
+ const query = map({
257
+ channelId: [, input.ChannelId],
258
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
259
+ nextToken: [, input.NextToken],
260
+ });
315
261
  let body;
316
262
  return new protocol_http_1.HttpRequest({
317
263
  protocol,
@@ -329,16 +275,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
329
275
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
330
276
  const headers = {};
331
277
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
332
- if (input.ResourceArn !== undefined) {
333
- const labelValue = input.ResourceArn;
334
- if (labelValue.length <= 0) {
335
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
336
- }
337
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
338
- }
339
- else {
340
- throw new Error("No value provided for input HTTP label: ResourceArn.");
341
- }
278
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
342
279
  let body;
343
280
  return new protocol_http_1.HttpRequest({
344
281
  protocol,
@@ -355,16 +292,7 @@ const serializeAws_restJson1RotateChannelCredentialsCommand = async (input, cont
355
292
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
356
293
  const headers = {};
357
294
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{Id}/credentials";
358
- if (input.Id !== undefined) {
359
- const labelValue = input.Id;
360
- if (labelValue.length <= 0) {
361
- throw new Error("Empty value provided for input HTTP label: Id.");
362
- }
363
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
364
- }
365
- else {
366
- throw new Error("No value provided for input HTTP label: Id.");
367
- }
295
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
368
296
  let body;
369
297
  return new protocol_http_1.HttpRequest({
370
298
  protocol,
@@ -382,26 +310,8 @@ const serializeAws_restJson1RotateIngestEndpointCredentialsCommand = async (inpu
382
310
  const headers = {};
383
311
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
384
312
  "/channels/{Id}/ingest_endpoints/{IngestEndpointId}/credentials";
385
- if (input.Id !== undefined) {
386
- const labelValue = input.Id;
387
- if (labelValue.length <= 0) {
388
- throw new Error("Empty value provided for input HTTP label: Id.");
389
- }
390
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
391
- }
392
- else {
393
- throw new Error("No value provided for input HTTP label: Id.");
394
- }
395
- if (input.IngestEndpointId !== undefined) {
396
- const labelValue = input.IngestEndpointId;
397
- if (labelValue.length <= 0) {
398
- throw new Error("Empty value provided for input HTTP label: IngestEndpointId.");
399
- }
400
- resolvedPath = resolvedPath.replace("{IngestEndpointId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
401
- }
402
- else {
403
- throw new Error("No value provided for input HTTP label: IngestEndpointId.");
404
- }
313
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
314
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IngestEndpointId", () => input.IngestEndpointId, "{IngestEndpointId}", false);
405
315
  let body;
406
316
  return new protocol_http_1.HttpRequest({
407
317
  protocol,
@@ -420,16 +330,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
420
330
  "content-type": "application/json",
421
331
  };
422
332
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
423
- if (input.ResourceArn !== undefined) {
424
- const labelValue = input.ResourceArn;
425
- if (labelValue.length <= 0) {
426
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
427
- }
428
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
429
- }
430
- else {
431
- throw new Error("No value provided for input HTTP label: ResourceArn.");
432
- }
333
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
433
334
  let body;
434
335
  body = JSON.stringify({
435
336
  ...(input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }),
@@ -449,19 +350,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
449
350
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
450
351
  const headers = {};
451
352
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
452
- if (input.ResourceArn !== undefined) {
453
- const labelValue = input.ResourceArn;
454
- if (labelValue.length <= 0) {
455
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
456
- }
457
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
458
- }
459
- else {
460
- throw new Error("No value provided for input HTTP label: ResourceArn.");
461
- }
462
- const query = {
463
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
464
- };
353
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
354
+ const query = map({
355
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
356
+ });
465
357
  let body;
466
358
  return new protocol_http_1.HttpRequest({
467
359
  protocol,
@@ -481,16 +373,7 @@ const serializeAws_restJson1UpdateChannelCommand = async (input, context) => {
481
373
  "content-type": "application/json",
482
374
  };
483
375
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/channels/{Id}";
484
- if (input.Id !== undefined) {
485
- const labelValue = input.Id;
486
- if (labelValue.length <= 0) {
487
- throw new Error("Empty value provided for input HTTP label: Id.");
488
- }
489
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
490
- }
491
- else {
492
- throw new Error("No value provided for input HTTP label: Id.");
493
- }
376
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
494
377
  let body;
495
378
  body = JSON.stringify({
496
379
  ...(input.Description != null && { description: input.Description }),
@@ -512,16 +395,7 @@ const serializeAws_restJson1UpdateOriginEndpointCommand = async (input, context)
512
395
  "content-type": "application/json",
513
396
  };
514
397
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/origin_endpoints/{Id}";
515
- if (input.Id !== undefined) {
516
- const labelValue = input.Id;
517
- if (labelValue.length <= 0) {
518
- throw new Error("Empty value provided for input HTTP label: Id.");
519
- }
520
- resolvedPath = resolvedPath.replace("{Id}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
521
- }
522
- else {
523
- throw new Error("No value provided for input HTTP label: Id.");
524
- }
398
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
525
399
  let body;
526
400
  body = JSON.stringify({
527
401
  ...(input.Authorization != null && {
@@ -555,39 +429,32 @@ const deserializeAws_restJson1ConfigureLogsCommand = async (output, context) =>
555
429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
556
430
  return deserializeAws_restJson1ConfigureLogsCommandError(output, context);
557
431
  }
558
- const contents = {
432
+ const contents = map({
559
433
  $metadata: deserializeMetadata(output),
560
- Arn: undefined,
561
- Description: undefined,
562
- EgressAccessLogs: undefined,
563
- HlsIngest: undefined,
564
- Id: undefined,
565
- IngressAccessLogs: undefined,
566
- Tags: undefined,
567
- };
434
+ });
568
435
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
569
- if (data.arn !== undefined && data.arn !== null) {
436
+ if (data.arn != null) {
570
437
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
571
438
  }
572
- if (data.description !== undefined && data.description !== null) {
439
+ if (data.description != null) {
573
440
  contents.Description = (0, smithy_client_1.expectString)(data.description);
574
441
  }
575
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
442
+ if (data.egressAccessLogs != null) {
576
443
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
577
444
  }
578
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
445
+ if (data.hlsIngest != null) {
579
446
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
580
447
  }
581
- if (data.id !== undefined && data.id !== null) {
448
+ if (data.id != null) {
582
449
  contents.Id = (0, smithy_client_1.expectString)(data.id);
583
450
  }
584
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
451
+ if (data.ingressAccessLogs != null) {
585
452
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
586
453
  }
587
- if (data.tags !== undefined && data.tags !== null) {
454
+ if (data.tags != null) {
588
455
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
589
456
  }
590
- return Promise.resolve(contents);
457
+ return contents;
591
458
  };
592
459
  exports.deserializeAws_restJson1ConfigureLogsCommand = deserializeAws_restJson1ConfigureLogsCommand;
593
460
  const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context) => {
@@ -595,7 +462,6 @@ const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context
595
462
  ...output,
596
463
  body: await parseBody(output.body, context),
597
464
  };
598
- let response;
599
465
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
600
466
  switch (errorCode) {
601
467
  case "ForbiddenException":
@@ -618,53 +484,44 @@ const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context
618
484
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
619
485
  default:
620
486
  const parsedBody = parsedOutput.body;
621
- const $metadata = deserializeMetadata(output);
622
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
623
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
624
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
625
- $fault: "client",
626
- $metadata,
487
+ (0, smithy_client_1.throwDefaultError)({
488
+ output,
489
+ parsedBody,
490
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
491
+ errorCode,
627
492
  });
628
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
629
493
  }
630
494
  };
631
495
  const deserializeAws_restJson1CreateChannelCommand = async (output, context) => {
632
496
  if (output.statusCode !== 200 && output.statusCode >= 300) {
633
497
  return deserializeAws_restJson1CreateChannelCommandError(output, context);
634
498
  }
635
- const contents = {
499
+ const contents = map({
636
500
  $metadata: deserializeMetadata(output),
637
- Arn: undefined,
638
- Description: undefined,
639
- EgressAccessLogs: undefined,
640
- HlsIngest: undefined,
641
- Id: undefined,
642
- IngressAccessLogs: undefined,
643
- Tags: undefined,
644
- };
501
+ });
645
502
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
646
- if (data.arn !== undefined && data.arn !== null) {
503
+ if (data.arn != null) {
647
504
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
648
505
  }
649
- if (data.description !== undefined && data.description !== null) {
506
+ if (data.description != null) {
650
507
  contents.Description = (0, smithy_client_1.expectString)(data.description);
651
508
  }
652
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
509
+ if (data.egressAccessLogs != null) {
653
510
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
654
511
  }
655
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
512
+ if (data.hlsIngest != null) {
656
513
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
657
514
  }
658
- if (data.id !== undefined && data.id !== null) {
515
+ if (data.id != null) {
659
516
  contents.Id = (0, smithy_client_1.expectString)(data.id);
660
517
  }
661
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
518
+ if (data.ingressAccessLogs != null) {
662
519
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
663
520
  }
664
- if (data.tags !== undefined && data.tags !== null) {
521
+ if (data.tags != null) {
665
522
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
666
523
  }
667
- return Promise.resolve(contents);
524
+ return contents;
668
525
  };
669
526
  exports.deserializeAws_restJson1CreateChannelCommand = deserializeAws_restJson1CreateChannelCommand;
670
527
  const deserializeAws_restJson1CreateChannelCommandError = async (output, context) => {
@@ -672,7 +529,6 @@ const deserializeAws_restJson1CreateChannelCommandError = async (output, context
672
529
  ...output,
673
530
  body: await parseBody(output.body, context),
674
531
  };
675
- let response;
676
532
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
677
533
  switch (errorCode) {
678
534
  case "ForbiddenException":
@@ -695,61 +551,50 @@ const deserializeAws_restJson1CreateChannelCommandError = async (output, context
695
551
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
696
552
  default:
697
553
  const parsedBody = parsedOutput.body;
698
- const $metadata = deserializeMetadata(output);
699
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
700
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
701
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
702
- $fault: "client",
703
- $metadata,
554
+ (0, smithy_client_1.throwDefaultError)({
555
+ output,
556
+ parsedBody,
557
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
558
+ errorCode,
704
559
  });
705
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
706
560
  }
707
561
  };
708
562
  const deserializeAws_restJson1CreateHarvestJobCommand = async (output, context) => {
709
563
  if (output.statusCode !== 200 && output.statusCode >= 300) {
710
564
  return deserializeAws_restJson1CreateHarvestJobCommandError(output, context);
711
565
  }
712
- const contents = {
566
+ const contents = map({
713
567
  $metadata: deserializeMetadata(output),
714
- Arn: undefined,
715
- ChannelId: undefined,
716
- CreatedAt: undefined,
717
- EndTime: undefined,
718
- Id: undefined,
719
- OriginEndpointId: undefined,
720
- S3Destination: undefined,
721
- StartTime: undefined,
722
- Status: undefined,
723
- };
568
+ });
724
569
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
725
- if (data.arn !== undefined && data.arn !== null) {
570
+ if (data.arn != null) {
726
571
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
727
572
  }
728
- if (data.channelId !== undefined && data.channelId !== null) {
573
+ if (data.channelId != null) {
729
574
  contents.ChannelId = (0, smithy_client_1.expectString)(data.channelId);
730
575
  }
731
- if (data.createdAt !== undefined && data.createdAt !== null) {
576
+ if (data.createdAt != null) {
732
577
  contents.CreatedAt = (0, smithy_client_1.expectString)(data.createdAt);
733
578
  }
734
- if (data.endTime !== undefined && data.endTime !== null) {
579
+ if (data.endTime != null) {
735
580
  contents.EndTime = (0, smithy_client_1.expectString)(data.endTime);
736
581
  }
737
- if (data.id !== undefined && data.id !== null) {
582
+ if (data.id != null) {
738
583
  contents.Id = (0, smithy_client_1.expectString)(data.id);
739
584
  }
740
- if (data.originEndpointId !== undefined && data.originEndpointId !== null) {
585
+ if (data.originEndpointId != null) {
741
586
  contents.OriginEndpointId = (0, smithy_client_1.expectString)(data.originEndpointId);
742
587
  }
743
- if (data.s3Destination !== undefined && data.s3Destination !== null) {
588
+ if (data.s3Destination != null) {
744
589
  contents.S3Destination = deserializeAws_restJson1S3Destination(data.s3Destination, context);
745
590
  }
746
- if (data.startTime !== undefined && data.startTime !== null) {
591
+ if (data.startTime != null) {
747
592
  contents.StartTime = (0, smithy_client_1.expectString)(data.startTime);
748
593
  }
749
- if (data.status !== undefined && data.status !== null) {
594
+ if (data.status != null) {
750
595
  contents.Status = (0, smithy_client_1.expectString)(data.status);
751
596
  }
752
- return Promise.resolve(contents);
597
+ return contents;
753
598
  };
754
599
  exports.deserializeAws_restJson1CreateHarvestJobCommand = deserializeAws_restJson1CreateHarvestJobCommand;
755
600
  const deserializeAws_restJson1CreateHarvestJobCommandError = async (output, context) => {
@@ -757,7 +602,6 @@ const deserializeAws_restJson1CreateHarvestJobCommandError = async (output, cont
757
602
  ...output,
758
603
  body: await parseBody(output.body, context),
759
604
  };
760
- let response;
761
605
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
762
606
  switch (errorCode) {
763
607
  case "ForbiddenException":
@@ -780,89 +624,71 @@ const deserializeAws_restJson1CreateHarvestJobCommandError = async (output, cont
780
624
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
781
625
  default:
782
626
  const parsedBody = parsedOutput.body;
783
- const $metadata = deserializeMetadata(output);
784
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
785
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
786
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
787
- $fault: "client",
788
- $metadata,
627
+ (0, smithy_client_1.throwDefaultError)({
628
+ output,
629
+ parsedBody,
630
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
631
+ errorCode,
789
632
  });
790
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
791
633
  }
792
634
  };
793
635
  const deserializeAws_restJson1CreateOriginEndpointCommand = async (output, context) => {
794
636
  if (output.statusCode !== 200 && output.statusCode >= 300) {
795
637
  return deserializeAws_restJson1CreateOriginEndpointCommandError(output, context);
796
638
  }
797
- const contents = {
639
+ const contents = map({
798
640
  $metadata: deserializeMetadata(output),
799
- Arn: undefined,
800
- Authorization: undefined,
801
- ChannelId: undefined,
802
- CmafPackage: undefined,
803
- DashPackage: undefined,
804
- Description: undefined,
805
- HlsPackage: undefined,
806
- Id: undefined,
807
- ManifestName: undefined,
808
- MssPackage: undefined,
809
- Origination: undefined,
810
- StartoverWindowSeconds: undefined,
811
- Tags: undefined,
812
- TimeDelaySeconds: undefined,
813
- Url: undefined,
814
- Whitelist: undefined,
815
- };
641
+ });
816
642
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
817
- if (data.arn !== undefined && data.arn !== null) {
643
+ if (data.arn != null) {
818
644
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
819
645
  }
820
- if (data.authorization !== undefined && data.authorization !== null) {
646
+ if (data.authorization != null) {
821
647
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
822
648
  }
823
- if (data.channelId !== undefined && data.channelId !== null) {
649
+ if (data.channelId != null) {
824
650
  contents.ChannelId = (0, smithy_client_1.expectString)(data.channelId);
825
651
  }
826
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
652
+ if (data.cmafPackage != null) {
827
653
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
828
654
  }
829
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
655
+ if (data.dashPackage != null) {
830
656
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
831
657
  }
832
- if (data.description !== undefined && data.description !== null) {
658
+ if (data.description != null) {
833
659
  contents.Description = (0, smithy_client_1.expectString)(data.description);
834
660
  }
835
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
661
+ if (data.hlsPackage != null) {
836
662
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
837
663
  }
838
- if (data.id !== undefined && data.id !== null) {
664
+ if (data.id != null) {
839
665
  contents.Id = (0, smithy_client_1.expectString)(data.id);
840
666
  }
841
- if (data.manifestName !== undefined && data.manifestName !== null) {
667
+ if (data.manifestName != null) {
842
668
  contents.ManifestName = (0, smithy_client_1.expectString)(data.manifestName);
843
669
  }
844
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
670
+ if (data.mssPackage != null) {
845
671
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
846
672
  }
847
- if (data.origination !== undefined && data.origination !== null) {
673
+ if (data.origination != null) {
848
674
  contents.Origination = (0, smithy_client_1.expectString)(data.origination);
849
675
  }
850
- if (data.startoverWindowSeconds !== undefined && data.startoverWindowSeconds !== null) {
676
+ if (data.startoverWindowSeconds != null) {
851
677
  contents.StartoverWindowSeconds = (0, smithy_client_1.expectInt32)(data.startoverWindowSeconds);
852
678
  }
853
- if (data.tags !== undefined && data.tags !== null) {
679
+ if (data.tags != null) {
854
680
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
855
681
  }
856
- if (data.timeDelaySeconds !== undefined && data.timeDelaySeconds !== null) {
682
+ if (data.timeDelaySeconds != null) {
857
683
  contents.TimeDelaySeconds = (0, smithy_client_1.expectInt32)(data.timeDelaySeconds);
858
684
  }
859
- if (data.url !== undefined && data.url !== null) {
685
+ if (data.url != null) {
860
686
  contents.Url = (0, smithy_client_1.expectString)(data.url);
861
687
  }
862
- if (data.whitelist !== undefined && data.whitelist !== null) {
688
+ if (data.whitelist != null) {
863
689
  contents.Whitelist = deserializeAws_restJson1__listOf__string(data.whitelist, context);
864
690
  }
865
- return Promise.resolve(contents);
691
+ return contents;
866
692
  };
867
693
  exports.deserializeAws_restJson1CreateOriginEndpointCommand = deserializeAws_restJson1CreateOriginEndpointCommand;
868
694
  const deserializeAws_restJson1CreateOriginEndpointCommandError = async (output, context) => {
@@ -870,7 +696,6 @@ const deserializeAws_restJson1CreateOriginEndpointCommandError = async (output,
870
696
  ...output,
871
697
  body: await parseBody(output.body, context),
872
698
  };
873
- let response;
874
699
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
875
700
  switch (errorCode) {
876
701
  case "ForbiddenException":
@@ -893,25 +718,23 @@ const deserializeAws_restJson1CreateOriginEndpointCommandError = async (output,
893
718
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
894
719
  default:
895
720
  const parsedBody = parsedOutput.body;
896
- const $metadata = deserializeMetadata(output);
897
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
898
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
899
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
900
- $fault: "client",
901
- $metadata,
721
+ (0, smithy_client_1.throwDefaultError)({
722
+ output,
723
+ parsedBody,
724
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
725
+ errorCode,
902
726
  });
903
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
904
727
  }
905
728
  };
906
729
  const deserializeAws_restJson1DeleteChannelCommand = async (output, context) => {
907
730
  if (output.statusCode !== 202 && output.statusCode >= 300) {
908
731
  return deserializeAws_restJson1DeleteChannelCommandError(output, context);
909
732
  }
910
- const contents = {
733
+ const contents = map({
911
734
  $metadata: deserializeMetadata(output),
912
- };
735
+ });
913
736
  await collectBody(output.body, context);
914
- return Promise.resolve(contents);
737
+ return contents;
915
738
  };
916
739
  exports.deserializeAws_restJson1DeleteChannelCommand = deserializeAws_restJson1DeleteChannelCommand;
917
740
  const deserializeAws_restJson1DeleteChannelCommandError = async (output, context) => {
@@ -919,7 +742,6 @@ const deserializeAws_restJson1DeleteChannelCommandError = async (output, context
919
742
  ...output,
920
743
  body: await parseBody(output.body, context),
921
744
  };
922
- let response;
923
745
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
924
746
  switch (errorCode) {
925
747
  case "ForbiddenException":
@@ -942,25 +764,23 @@ const deserializeAws_restJson1DeleteChannelCommandError = async (output, context
942
764
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
943
765
  default:
944
766
  const parsedBody = parsedOutput.body;
945
- const $metadata = deserializeMetadata(output);
946
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
947
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
948
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
949
- $fault: "client",
950
- $metadata,
767
+ (0, smithy_client_1.throwDefaultError)({
768
+ output,
769
+ parsedBody,
770
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
771
+ errorCode,
951
772
  });
952
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
953
773
  }
954
774
  };
955
775
  const deserializeAws_restJson1DeleteOriginEndpointCommand = async (output, context) => {
956
776
  if (output.statusCode !== 202 && output.statusCode >= 300) {
957
777
  return deserializeAws_restJson1DeleteOriginEndpointCommandError(output, context);
958
778
  }
959
- const contents = {
779
+ const contents = map({
960
780
  $metadata: deserializeMetadata(output),
961
- };
781
+ });
962
782
  await collectBody(output.body, context);
963
- return Promise.resolve(contents);
783
+ return contents;
964
784
  };
965
785
  exports.deserializeAws_restJson1DeleteOriginEndpointCommand = deserializeAws_restJson1DeleteOriginEndpointCommand;
966
786
  const deserializeAws_restJson1DeleteOriginEndpointCommandError = async (output, context) => {
@@ -968,7 +788,6 @@ const deserializeAws_restJson1DeleteOriginEndpointCommandError = async (output,
968
788
  ...output,
969
789
  body: await parseBody(output.body, context),
970
790
  };
971
- let response;
972
791
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
973
792
  switch (errorCode) {
974
793
  case "ForbiddenException":
@@ -991,53 +810,44 @@ const deserializeAws_restJson1DeleteOriginEndpointCommandError = async (output,
991
810
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
992
811
  default:
993
812
  const parsedBody = parsedOutput.body;
994
- const $metadata = deserializeMetadata(output);
995
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
996
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
997
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
998
- $fault: "client",
999
- $metadata,
813
+ (0, smithy_client_1.throwDefaultError)({
814
+ output,
815
+ parsedBody,
816
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
817
+ errorCode,
1000
818
  });
1001
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1002
819
  }
1003
820
  };
1004
821
  const deserializeAws_restJson1DescribeChannelCommand = async (output, context) => {
1005
822
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1006
823
  return deserializeAws_restJson1DescribeChannelCommandError(output, context);
1007
824
  }
1008
- const contents = {
825
+ const contents = map({
1009
826
  $metadata: deserializeMetadata(output),
1010
- Arn: undefined,
1011
- Description: undefined,
1012
- EgressAccessLogs: undefined,
1013
- HlsIngest: undefined,
1014
- Id: undefined,
1015
- IngressAccessLogs: undefined,
1016
- Tags: undefined,
1017
- };
827
+ });
1018
828
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1019
- if (data.arn !== undefined && data.arn !== null) {
829
+ if (data.arn != null) {
1020
830
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1021
831
  }
1022
- if (data.description !== undefined && data.description !== null) {
832
+ if (data.description != null) {
1023
833
  contents.Description = (0, smithy_client_1.expectString)(data.description);
1024
834
  }
1025
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
835
+ if (data.egressAccessLogs != null) {
1026
836
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1027
837
  }
1028
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
838
+ if (data.hlsIngest != null) {
1029
839
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1030
840
  }
1031
- if (data.id !== undefined && data.id !== null) {
841
+ if (data.id != null) {
1032
842
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1033
843
  }
1034
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
844
+ if (data.ingressAccessLogs != null) {
1035
845
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1036
846
  }
1037
- if (data.tags !== undefined && data.tags !== null) {
847
+ if (data.tags != null) {
1038
848
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1039
849
  }
1040
- return Promise.resolve(contents);
850
+ return contents;
1041
851
  };
1042
852
  exports.deserializeAws_restJson1DescribeChannelCommand = deserializeAws_restJson1DescribeChannelCommand;
1043
853
  const deserializeAws_restJson1DescribeChannelCommandError = async (output, context) => {
@@ -1045,7 +855,6 @@ const deserializeAws_restJson1DescribeChannelCommandError = async (output, conte
1045
855
  ...output,
1046
856
  body: await parseBody(output.body, context),
1047
857
  };
1048
- let response;
1049
858
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1050
859
  switch (errorCode) {
1051
860
  case "ForbiddenException":
@@ -1068,61 +877,50 @@ const deserializeAws_restJson1DescribeChannelCommandError = async (output, conte
1068
877
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1069
878
  default:
1070
879
  const parsedBody = parsedOutput.body;
1071
- const $metadata = deserializeMetadata(output);
1072
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1073
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1074
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1075
- $fault: "client",
1076
- $metadata,
880
+ (0, smithy_client_1.throwDefaultError)({
881
+ output,
882
+ parsedBody,
883
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
884
+ errorCode,
1077
885
  });
1078
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1079
886
  }
1080
887
  };
1081
888
  const deserializeAws_restJson1DescribeHarvestJobCommand = async (output, context) => {
1082
889
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1083
890
  return deserializeAws_restJson1DescribeHarvestJobCommandError(output, context);
1084
891
  }
1085
- const contents = {
892
+ const contents = map({
1086
893
  $metadata: deserializeMetadata(output),
1087
- Arn: undefined,
1088
- ChannelId: undefined,
1089
- CreatedAt: undefined,
1090
- EndTime: undefined,
1091
- Id: undefined,
1092
- OriginEndpointId: undefined,
1093
- S3Destination: undefined,
1094
- StartTime: undefined,
1095
- Status: undefined,
1096
- };
894
+ });
1097
895
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1098
- if (data.arn !== undefined && data.arn !== null) {
896
+ if (data.arn != null) {
1099
897
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1100
898
  }
1101
- if (data.channelId !== undefined && data.channelId !== null) {
899
+ if (data.channelId != null) {
1102
900
  contents.ChannelId = (0, smithy_client_1.expectString)(data.channelId);
1103
901
  }
1104
- if (data.createdAt !== undefined && data.createdAt !== null) {
902
+ if (data.createdAt != null) {
1105
903
  contents.CreatedAt = (0, smithy_client_1.expectString)(data.createdAt);
1106
904
  }
1107
- if (data.endTime !== undefined && data.endTime !== null) {
905
+ if (data.endTime != null) {
1108
906
  contents.EndTime = (0, smithy_client_1.expectString)(data.endTime);
1109
907
  }
1110
- if (data.id !== undefined && data.id !== null) {
908
+ if (data.id != null) {
1111
909
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1112
910
  }
1113
- if (data.originEndpointId !== undefined && data.originEndpointId !== null) {
911
+ if (data.originEndpointId != null) {
1114
912
  contents.OriginEndpointId = (0, smithy_client_1.expectString)(data.originEndpointId);
1115
913
  }
1116
- if (data.s3Destination !== undefined && data.s3Destination !== null) {
914
+ if (data.s3Destination != null) {
1117
915
  contents.S3Destination = deserializeAws_restJson1S3Destination(data.s3Destination, context);
1118
916
  }
1119
- if (data.startTime !== undefined && data.startTime !== null) {
917
+ if (data.startTime != null) {
1120
918
  contents.StartTime = (0, smithy_client_1.expectString)(data.startTime);
1121
919
  }
1122
- if (data.status !== undefined && data.status !== null) {
920
+ if (data.status != null) {
1123
921
  contents.Status = (0, smithy_client_1.expectString)(data.status);
1124
922
  }
1125
- return Promise.resolve(contents);
923
+ return contents;
1126
924
  };
1127
925
  exports.deserializeAws_restJson1DescribeHarvestJobCommand = deserializeAws_restJson1DescribeHarvestJobCommand;
1128
926
  const deserializeAws_restJson1DescribeHarvestJobCommandError = async (output, context) => {
@@ -1130,7 +928,6 @@ const deserializeAws_restJson1DescribeHarvestJobCommandError = async (output, co
1130
928
  ...output,
1131
929
  body: await parseBody(output.body, context),
1132
930
  };
1133
- let response;
1134
931
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1135
932
  switch (errorCode) {
1136
933
  case "ForbiddenException":
@@ -1153,89 +950,71 @@ const deserializeAws_restJson1DescribeHarvestJobCommandError = async (output, co
1153
950
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1154
951
  default:
1155
952
  const parsedBody = parsedOutput.body;
1156
- const $metadata = deserializeMetadata(output);
1157
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1158
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1159
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1160
- $fault: "client",
1161
- $metadata,
953
+ (0, smithy_client_1.throwDefaultError)({
954
+ output,
955
+ parsedBody,
956
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
957
+ errorCode,
1162
958
  });
1163
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1164
959
  }
1165
960
  };
1166
961
  const deserializeAws_restJson1DescribeOriginEndpointCommand = async (output, context) => {
1167
962
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1168
963
  return deserializeAws_restJson1DescribeOriginEndpointCommandError(output, context);
1169
964
  }
1170
- const contents = {
965
+ const contents = map({
1171
966
  $metadata: deserializeMetadata(output),
1172
- Arn: undefined,
1173
- Authorization: undefined,
1174
- ChannelId: undefined,
1175
- CmafPackage: undefined,
1176
- DashPackage: undefined,
1177
- Description: undefined,
1178
- HlsPackage: undefined,
1179
- Id: undefined,
1180
- ManifestName: undefined,
1181
- MssPackage: undefined,
1182
- Origination: undefined,
1183
- StartoverWindowSeconds: undefined,
1184
- Tags: undefined,
1185
- TimeDelaySeconds: undefined,
1186
- Url: undefined,
1187
- Whitelist: undefined,
1188
- };
967
+ });
1189
968
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1190
- if (data.arn !== undefined && data.arn !== null) {
969
+ if (data.arn != null) {
1191
970
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1192
971
  }
1193
- if (data.authorization !== undefined && data.authorization !== null) {
972
+ if (data.authorization != null) {
1194
973
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1195
974
  }
1196
- if (data.channelId !== undefined && data.channelId !== null) {
975
+ if (data.channelId != null) {
1197
976
  contents.ChannelId = (0, smithy_client_1.expectString)(data.channelId);
1198
977
  }
1199
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
978
+ if (data.cmafPackage != null) {
1200
979
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
1201
980
  }
1202
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
981
+ if (data.dashPackage != null) {
1203
982
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
1204
983
  }
1205
- if (data.description !== undefined && data.description !== null) {
984
+ if (data.description != null) {
1206
985
  contents.Description = (0, smithy_client_1.expectString)(data.description);
1207
986
  }
1208
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
987
+ if (data.hlsPackage != null) {
1209
988
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
1210
989
  }
1211
- if (data.id !== undefined && data.id !== null) {
990
+ if (data.id != null) {
1212
991
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1213
992
  }
1214
- if (data.manifestName !== undefined && data.manifestName !== null) {
993
+ if (data.manifestName != null) {
1215
994
  contents.ManifestName = (0, smithy_client_1.expectString)(data.manifestName);
1216
995
  }
1217
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
996
+ if (data.mssPackage != null) {
1218
997
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
1219
998
  }
1220
- if (data.origination !== undefined && data.origination !== null) {
999
+ if (data.origination != null) {
1221
1000
  contents.Origination = (0, smithy_client_1.expectString)(data.origination);
1222
1001
  }
1223
- if (data.startoverWindowSeconds !== undefined && data.startoverWindowSeconds !== null) {
1002
+ if (data.startoverWindowSeconds != null) {
1224
1003
  contents.StartoverWindowSeconds = (0, smithy_client_1.expectInt32)(data.startoverWindowSeconds);
1225
1004
  }
1226
- if (data.tags !== undefined && data.tags !== null) {
1005
+ if (data.tags != null) {
1227
1006
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1228
1007
  }
1229
- if (data.timeDelaySeconds !== undefined && data.timeDelaySeconds !== null) {
1008
+ if (data.timeDelaySeconds != null) {
1230
1009
  contents.TimeDelaySeconds = (0, smithy_client_1.expectInt32)(data.timeDelaySeconds);
1231
1010
  }
1232
- if (data.url !== undefined && data.url !== null) {
1011
+ if (data.url != null) {
1233
1012
  contents.Url = (0, smithy_client_1.expectString)(data.url);
1234
1013
  }
1235
- if (data.whitelist !== undefined && data.whitelist !== null) {
1014
+ if (data.whitelist != null) {
1236
1015
  contents.Whitelist = deserializeAws_restJson1__listOf__string(data.whitelist, context);
1237
1016
  }
1238
- return Promise.resolve(contents);
1017
+ return contents;
1239
1018
  };
1240
1019
  exports.deserializeAws_restJson1DescribeOriginEndpointCommand = deserializeAws_restJson1DescribeOriginEndpointCommand;
1241
1020
  const deserializeAws_restJson1DescribeOriginEndpointCommandError = async (output, context) => {
@@ -1243,7 +1022,6 @@ const deserializeAws_restJson1DescribeOriginEndpointCommandError = async (output
1243
1022
  ...output,
1244
1023
  body: await parseBody(output.body, context),
1245
1024
  };
1246
- let response;
1247
1025
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1248
1026
  switch (errorCode) {
1249
1027
  case "ForbiddenException":
@@ -1266,33 +1044,29 @@ const deserializeAws_restJson1DescribeOriginEndpointCommandError = async (output
1266
1044
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1267
1045
  default:
1268
1046
  const parsedBody = parsedOutput.body;
1269
- const $metadata = deserializeMetadata(output);
1270
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1271
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1272
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1273
- $fault: "client",
1274
- $metadata,
1047
+ (0, smithy_client_1.throwDefaultError)({
1048
+ output,
1049
+ parsedBody,
1050
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1051
+ errorCode,
1275
1052
  });
1276
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1277
1053
  }
1278
1054
  };
1279
1055
  const deserializeAws_restJson1ListChannelsCommand = async (output, context) => {
1280
1056
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1281
1057
  return deserializeAws_restJson1ListChannelsCommandError(output, context);
1282
1058
  }
1283
- const contents = {
1059
+ const contents = map({
1284
1060
  $metadata: deserializeMetadata(output),
1285
- Channels: undefined,
1286
- NextToken: undefined,
1287
- };
1061
+ });
1288
1062
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1289
- if (data.channels !== undefined && data.channels !== null) {
1063
+ if (data.channels != null) {
1290
1064
  contents.Channels = deserializeAws_restJson1__listOfChannel(data.channels, context);
1291
1065
  }
1292
- if (data.nextToken !== undefined && data.nextToken !== null) {
1066
+ if (data.nextToken != null) {
1293
1067
  contents.NextToken = (0, smithy_client_1.expectString)(data.nextToken);
1294
1068
  }
1295
- return Promise.resolve(contents);
1069
+ return contents;
1296
1070
  };
1297
1071
  exports.deserializeAws_restJson1ListChannelsCommand = deserializeAws_restJson1ListChannelsCommand;
1298
1072
  const deserializeAws_restJson1ListChannelsCommandError = async (output, context) => {
@@ -1300,7 +1074,6 @@ const deserializeAws_restJson1ListChannelsCommandError = async (output, context)
1300
1074
  ...output,
1301
1075
  body: await parseBody(output.body, context),
1302
1076
  };
1303
- let response;
1304
1077
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1305
1078
  switch (errorCode) {
1306
1079
  case "ForbiddenException":
@@ -1323,33 +1096,29 @@ const deserializeAws_restJson1ListChannelsCommandError = async (output, context)
1323
1096
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1324
1097
  default:
1325
1098
  const parsedBody = parsedOutput.body;
1326
- const $metadata = deserializeMetadata(output);
1327
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1328
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1329
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1330
- $fault: "client",
1331
- $metadata,
1099
+ (0, smithy_client_1.throwDefaultError)({
1100
+ output,
1101
+ parsedBody,
1102
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1103
+ errorCode,
1332
1104
  });
1333
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1334
1105
  }
1335
1106
  };
1336
1107
  const deserializeAws_restJson1ListHarvestJobsCommand = async (output, context) => {
1337
1108
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1338
1109
  return deserializeAws_restJson1ListHarvestJobsCommandError(output, context);
1339
1110
  }
1340
- const contents = {
1111
+ const contents = map({
1341
1112
  $metadata: deserializeMetadata(output),
1342
- HarvestJobs: undefined,
1343
- NextToken: undefined,
1344
- };
1113
+ });
1345
1114
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1346
- if (data.harvestJobs !== undefined && data.harvestJobs !== null) {
1115
+ if (data.harvestJobs != null) {
1347
1116
  contents.HarvestJobs = deserializeAws_restJson1__listOfHarvestJob(data.harvestJobs, context);
1348
1117
  }
1349
- if (data.nextToken !== undefined && data.nextToken !== null) {
1118
+ if (data.nextToken != null) {
1350
1119
  contents.NextToken = (0, smithy_client_1.expectString)(data.nextToken);
1351
1120
  }
1352
- return Promise.resolve(contents);
1121
+ return contents;
1353
1122
  };
1354
1123
  exports.deserializeAws_restJson1ListHarvestJobsCommand = deserializeAws_restJson1ListHarvestJobsCommand;
1355
1124
  const deserializeAws_restJson1ListHarvestJobsCommandError = async (output, context) => {
@@ -1357,7 +1126,6 @@ const deserializeAws_restJson1ListHarvestJobsCommandError = async (output, conte
1357
1126
  ...output,
1358
1127
  body: await parseBody(output.body, context),
1359
1128
  };
1360
- let response;
1361
1129
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1362
1130
  switch (errorCode) {
1363
1131
  case "ForbiddenException":
@@ -1380,33 +1148,29 @@ const deserializeAws_restJson1ListHarvestJobsCommandError = async (output, conte
1380
1148
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1381
1149
  default:
1382
1150
  const parsedBody = parsedOutput.body;
1383
- const $metadata = deserializeMetadata(output);
1384
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1385
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1386
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1387
- $fault: "client",
1388
- $metadata,
1151
+ (0, smithy_client_1.throwDefaultError)({
1152
+ output,
1153
+ parsedBody,
1154
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1155
+ errorCode,
1389
1156
  });
1390
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1391
1157
  }
1392
1158
  };
1393
1159
  const deserializeAws_restJson1ListOriginEndpointsCommand = async (output, context) => {
1394
1160
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1395
1161
  return deserializeAws_restJson1ListOriginEndpointsCommandError(output, context);
1396
1162
  }
1397
- const contents = {
1163
+ const contents = map({
1398
1164
  $metadata: deserializeMetadata(output),
1399
- NextToken: undefined,
1400
- OriginEndpoints: undefined,
1401
- };
1165
+ });
1402
1166
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1403
- if (data.nextToken !== undefined && data.nextToken !== null) {
1167
+ if (data.nextToken != null) {
1404
1168
  contents.NextToken = (0, smithy_client_1.expectString)(data.nextToken);
1405
1169
  }
1406
- if (data.originEndpoints !== undefined && data.originEndpoints !== null) {
1170
+ if (data.originEndpoints != null) {
1407
1171
  contents.OriginEndpoints = deserializeAws_restJson1__listOfOriginEndpoint(data.originEndpoints, context);
1408
1172
  }
1409
- return Promise.resolve(contents);
1173
+ return contents;
1410
1174
  };
1411
1175
  exports.deserializeAws_restJson1ListOriginEndpointsCommand = deserializeAws_restJson1ListOriginEndpointsCommand;
1412
1176
  const deserializeAws_restJson1ListOriginEndpointsCommandError = async (output, context) => {
@@ -1414,7 +1178,6 @@ const deserializeAws_restJson1ListOriginEndpointsCommandError = async (output, c
1414
1178
  ...output,
1415
1179
  body: await parseBody(output.body, context),
1416
1180
  };
1417
- let response;
1418
1181
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1419
1182
  switch (errorCode) {
1420
1183
  case "ForbiddenException":
@@ -1437,29 +1200,26 @@ const deserializeAws_restJson1ListOriginEndpointsCommandError = async (output, c
1437
1200
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1438
1201
  default:
1439
1202
  const parsedBody = parsedOutput.body;
1440
- const $metadata = deserializeMetadata(output);
1441
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1442
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1443
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1444
- $fault: "client",
1445
- $metadata,
1203
+ (0, smithy_client_1.throwDefaultError)({
1204
+ output,
1205
+ parsedBody,
1206
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1207
+ errorCode,
1446
1208
  });
1447
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1448
1209
  }
1449
1210
  };
1450
1211
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1451
1212
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1452
1213
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1453
1214
  }
1454
- const contents = {
1215
+ const contents = map({
1455
1216
  $metadata: deserializeMetadata(output),
1456
- Tags: undefined,
1457
- };
1217
+ });
1458
1218
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1459
- if (data.tags !== undefined && data.tags !== null) {
1219
+ if (data.tags != null) {
1460
1220
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1461
1221
  }
1462
- return Promise.resolve(contents);
1222
+ return contents;
1463
1223
  };
1464
1224
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1465
1225
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1467,58 +1227,45 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1467
1227
  ...output,
1468
1228
  body: await parseBody(output.body, context),
1469
1229
  };
1470
- let response;
1471
1230
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1472
- switch (errorCode) {
1473
- default:
1474
- const parsedBody = parsedOutput.body;
1475
- const $metadata = deserializeMetadata(output);
1476
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1477
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1478
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1479
- $fault: "client",
1480
- $metadata,
1481
- });
1482
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1483
- }
1231
+ const parsedBody = parsedOutput.body;
1232
+ (0, smithy_client_1.throwDefaultError)({
1233
+ output,
1234
+ parsedBody,
1235
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1236
+ errorCode,
1237
+ });
1484
1238
  };
1485
1239
  const deserializeAws_restJson1RotateChannelCredentialsCommand = async (output, context) => {
1486
1240
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1487
1241
  return deserializeAws_restJson1RotateChannelCredentialsCommandError(output, context);
1488
1242
  }
1489
- const contents = {
1243
+ const contents = map({
1490
1244
  $metadata: deserializeMetadata(output),
1491
- Arn: undefined,
1492
- Description: undefined,
1493
- EgressAccessLogs: undefined,
1494
- HlsIngest: undefined,
1495
- Id: undefined,
1496
- IngressAccessLogs: undefined,
1497
- Tags: undefined,
1498
- };
1245
+ });
1499
1246
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1500
- if (data.arn !== undefined && data.arn !== null) {
1247
+ if (data.arn != null) {
1501
1248
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1502
1249
  }
1503
- if (data.description !== undefined && data.description !== null) {
1250
+ if (data.description != null) {
1504
1251
  contents.Description = (0, smithy_client_1.expectString)(data.description);
1505
1252
  }
1506
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1253
+ if (data.egressAccessLogs != null) {
1507
1254
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1508
1255
  }
1509
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1256
+ if (data.hlsIngest != null) {
1510
1257
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1511
1258
  }
1512
- if (data.id !== undefined && data.id !== null) {
1259
+ if (data.id != null) {
1513
1260
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1514
1261
  }
1515
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1262
+ if (data.ingressAccessLogs != null) {
1516
1263
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1517
1264
  }
1518
- if (data.tags !== undefined && data.tags !== null) {
1265
+ if (data.tags != null) {
1519
1266
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1520
1267
  }
1521
- return Promise.resolve(contents);
1268
+ return contents;
1522
1269
  };
1523
1270
  exports.deserializeAws_restJson1RotateChannelCredentialsCommand = deserializeAws_restJson1RotateChannelCredentialsCommand;
1524
1271
  const deserializeAws_restJson1RotateChannelCredentialsCommandError = async (output, context) => {
@@ -1526,7 +1273,6 @@ const deserializeAws_restJson1RotateChannelCredentialsCommandError = async (outp
1526
1273
  ...output,
1527
1274
  body: await parseBody(output.body, context),
1528
1275
  };
1529
- let response;
1530
1276
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1531
1277
  switch (errorCode) {
1532
1278
  case "ForbiddenException":
@@ -1549,53 +1295,44 @@ const deserializeAws_restJson1RotateChannelCredentialsCommandError = async (outp
1549
1295
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1550
1296
  default:
1551
1297
  const parsedBody = parsedOutput.body;
1552
- const $metadata = deserializeMetadata(output);
1553
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1554
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1555
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1556
- $fault: "client",
1557
- $metadata,
1298
+ (0, smithy_client_1.throwDefaultError)({
1299
+ output,
1300
+ parsedBody,
1301
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1302
+ errorCode,
1558
1303
  });
1559
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1560
1304
  }
1561
1305
  };
1562
1306
  const deserializeAws_restJson1RotateIngestEndpointCredentialsCommand = async (output, context) => {
1563
1307
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1564
1308
  return deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError(output, context);
1565
1309
  }
1566
- const contents = {
1310
+ const contents = map({
1567
1311
  $metadata: deserializeMetadata(output),
1568
- Arn: undefined,
1569
- Description: undefined,
1570
- EgressAccessLogs: undefined,
1571
- HlsIngest: undefined,
1572
- Id: undefined,
1573
- IngressAccessLogs: undefined,
1574
- Tags: undefined,
1575
- };
1312
+ });
1576
1313
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1577
- if (data.arn !== undefined && data.arn !== null) {
1314
+ if (data.arn != null) {
1578
1315
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1579
1316
  }
1580
- if (data.description !== undefined && data.description !== null) {
1317
+ if (data.description != null) {
1581
1318
  contents.Description = (0, smithy_client_1.expectString)(data.description);
1582
1319
  }
1583
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1320
+ if (data.egressAccessLogs != null) {
1584
1321
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1585
1322
  }
1586
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1323
+ if (data.hlsIngest != null) {
1587
1324
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1588
1325
  }
1589
- if (data.id !== undefined && data.id !== null) {
1326
+ if (data.id != null) {
1590
1327
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1591
1328
  }
1592
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1329
+ if (data.ingressAccessLogs != null) {
1593
1330
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1594
1331
  }
1595
- if (data.tags !== undefined && data.tags !== null) {
1332
+ if (data.tags != null) {
1596
1333
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1597
1334
  }
1598
- return Promise.resolve(contents);
1335
+ return contents;
1599
1336
  };
1600
1337
  exports.deserializeAws_restJson1RotateIngestEndpointCredentialsCommand = deserializeAws_restJson1RotateIngestEndpointCredentialsCommand;
1601
1338
  const deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError = async (output, context) => {
@@ -1603,7 +1340,6 @@ const deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError = asyn
1603
1340
  ...output,
1604
1341
  body: await parseBody(output.body, context),
1605
1342
  };
1606
- let response;
1607
1343
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1608
1344
  switch (errorCode) {
1609
1345
  case "ForbiddenException":
@@ -1626,25 +1362,23 @@ const deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError = asyn
1626
1362
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1627
1363
  default:
1628
1364
  const parsedBody = parsedOutput.body;
1629
- const $metadata = deserializeMetadata(output);
1630
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1631
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1632
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1633
- $fault: "client",
1634
- $metadata,
1365
+ (0, smithy_client_1.throwDefaultError)({
1366
+ output,
1367
+ parsedBody,
1368
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1369
+ errorCode,
1635
1370
  });
1636
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1637
1371
  }
1638
1372
  };
1639
1373
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1640
1374
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1641
1375
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1642
1376
  }
1643
- const contents = {
1377
+ const contents = map({
1644
1378
  $metadata: deserializeMetadata(output),
1645
- };
1379
+ });
1646
1380
  await collectBody(output.body, context);
1647
- return Promise.resolve(contents);
1381
+ return contents;
1648
1382
  };
1649
1383
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1650
1384
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1652,30 +1386,24 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1652
1386
  ...output,
1653
1387
  body: await parseBody(output.body, context),
1654
1388
  };
1655
- let response;
1656
1389
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1657
- switch (errorCode) {
1658
- default:
1659
- const parsedBody = parsedOutput.body;
1660
- const $metadata = deserializeMetadata(output);
1661
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1662
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1663
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1664
- $fault: "client",
1665
- $metadata,
1666
- });
1667
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1668
- }
1390
+ const parsedBody = parsedOutput.body;
1391
+ (0, smithy_client_1.throwDefaultError)({
1392
+ output,
1393
+ parsedBody,
1394
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1395
+ errorCode,
1396
+ });
1669
1397
  };
1670
1398
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1671
1399
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1672
1400
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1673
1401
  }
1674
- const contents = {
1402
+ const contents = map({
1675
1403
  $metadata: deserializeMetadata(output),
1676
- };
1404
+ });
1677
1405
  await collectBody(output.body, context);
1678
- return Promise.resolve(contents);
1406
+ return contents;
1679
1407
  };
1680
1408
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1681
1409
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1683,58 +1411,45 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1683
1411
  ...output,
1684
1412
  body: await parseBody(output.body, context),
1685
1413
  };
1686
- let response;
1687
1414
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1688
- switch (errorCode) {
1689
- default:
1690
- const parsedBody = parsedOutput.body;
1691
- const $metadata = deserializeMetadata(output);
1692
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1693
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1694
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1695
- $fault: "client",
1696
- $metadata,
1697
- });
1698
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1699
- }
1415
+ const parsedBody = parsedOutput.body;
1416
+ (0, smithy_client_1.throwDefaultError)({
1417
+ output,
1418
+ parsedBody,
1419
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1420
+ errorCode,
1421
+ });
1700
1422
  };
1701
1423
  const deserializeAws_restJson1UpdateChannelCommand = async (output, context) => {
1702
1424
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1703
1425
  return deserializeAws_restJson1UpdateChannelCommandError(output, context);
1704
1426
  }
1705
- const contents = {
1427
+ const contents = map({
1706
1428
  $metadata: deserializeMetadata(output),
1707
- Arn: undefined,
1708
- Description: undefined,
1709
- EgressAccessLogs: undefined,
1710
- HlsIngest: undefined,
1711
- Id: undefined,
1712
- IngressAccessLogs: undefined,
1713
- Tags: undefined,
1714
- };
1429
+ });
1715
1430
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1716
- if (data.arn !== undefined && data.arn !== null) {
1431
+ if (data.arn != null) {
1717
1432
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1718
1433
  }
1719
- if (data.description !== undefined && data.description !== null) {
1434
+ if (data.description != null) {
1720
1435
  contents.Description = (0, smithy_client_1.expectString)(data.description);
1721
1436
  }
1722
- if (data.egressAccessLogs !== undefined && data.egressAccessLogs !== null) {
1437
+ if (data.egressAccessLogs != null) {
1723
1438
  contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1724
1439
  }
1725
- if (data.hlsIngest !== undefined && data.hlsIngest !== null) {
1440
+ if (data.hlsIngest != null) {
1726
1441
  contents.HlsIngest = deserializeAws_restJson1HlsIngest(data.hlsIngest, context);
1727
1442
  }
1728
- if (data.id !== undefined && data.id !== null) {
1443
+ if (data.id != null) {
1729
1444
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1730
1445
  }
1731
- if (data.ingressAccessLogs !== undefined && data.ingressAccessLogs !== null) {
1446
+ if (data.ingressAccessLogs != null) {
1732
1447
  contents.IngressAccessLogs = deserializeAws_restJson1IngressAccessLogs(data.ingressAccessLogs, context);
1733
1448
  }
1734
- if (data.tags !== undefined && data.tags !== null) {
1449
+ if (data.tags != null) {
1735
1450
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1736
1451
  }
1737
- return Promise.resolve(contents);
1452
+ return contents;
1738
1453
  };
1739
1454
  exports.deserializeAws_restJson1UpdateChannelCommand = deserializeAws_restJson1UpdateChannelCommand;
1740
1455
  const deserializeAws_restJson1UpdateChannelCommandError = async (output, context) => {
@@ -1742,7 +1457,6 @@ const deserializeAws_restJson1UpdateChannelCommandError = async (output, context
1742
1457
  ...output,
1743
1458
  body: await parseBody(output.body, context),
1744
1459
  };
1745
- let response;
1746
1460
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1747
1461
  switch (errorCode) {
1748
1462
  case "ForbiddenException":
@@ -1765,89 +1479,71 @@ const deserializeAws_restJson1UpdateChannelCommandError = async (output, context
1765
1479
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1766
1480
  default:
1767
1481
  const parsedBody = parsedOutput.body;
1768
- const $metadata = deserializeMetadata(output);
1769
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1770
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1771
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1772
- $fault: "client",
1773
- $metadata,
1482
+ (0, smithy_client_1.throwDefaultError)({
1483
+ output,
1484
+ parsedBody,
1485
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1486
+ errorCode,
1774
1487
  });
1775
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1776
1488
  }
1777
1489
  };
1778
1490
  const deserializeAws_restJson1UpdateOriginEndpointCommand = async (output, context) => {
1779
1491
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1780
1492
  return deserializeAws_restJson1UpdateOriginEndpointCommandError(output, context);
1781
1493
  }
1782
- const contents = {
1494
+ const contents = map({
1783
1495
  $metadata: deserializeMetadata(output),
1784
- Arn: undefined,
1785
- Authorization: undefined,
1786
- ChannelId: undefined,
1787
- CmafPackage: undefined,
1788
- DashPackage: undefined,
1789
- Description: undefined,
1790
- HlsPackage: undefined,
1791
- Id: undefined,
1792
- ManifestName: undefined,
1793
- MssPackage: undefined,
1794
- Origination: undefined,
1795
- StartoverWindowSeconds: undefined,
1796
- Tags: undefined,
1797
- TimeDelaySeconds: undefined,
1798
- Url: undefined,
1799
- Whitelist: undefined,
1800
- };
1496
+ });
1801
1497
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1802
- if (data.arn !== undefined && data.arn !== null) {
1498
+ if (data.arn != null) {
1803
1499
  contents.Arn = (0, smithy_client_1.expectString)(data.arn);
1804
1500
  }
1805
- if (data.authorization !== undefined && data.authorization !== null) {
1501
+ if (data.authorization != null) {
1806
1502
  contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1807
1503
  }
1808
- if (data.channelId !== undefined && data.channelId !== null) {
1504
+ if (data.channelId != null) {
1809
1505
  contents.ChannelId = (0, smithy_client_1.expectString)(data.channelId);
1810
1506
  }
1811
- if (data.cmafPackage !== undefined && data.cmafPackage !== null) {
1507
+ if (data.cmafPackage != null) {
1812
1508
  contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
1813
1509
  }
1814
- if (data.dashPackage !== undefined && data.dashPackage !== null) {
1510
+ if (data.dashPackage != null) {
1815
1511
  contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
1816
1512
  }
1817
- if (data.description !== undefined && data.description !== null) {
1513
+ if (data.description != null) {
1818
1514
  contents.Description = (0, smithy_client_1.expectString)(data.description);
1819
1515
  }
1820
- if (data.hlsPackage !== undefined && data.hlsPackage !== null) {
1516
+ if (data.hlsPackage != null) {
1821
1517
  contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
1822
1518
  }
1823
- if (data.id !== undefined && data.id !== null) {
1519
+ if (data.id != null) {
1824
1520
  contents.Id = (0, smithy_client_1.expectString)(data.id);
1825
1521
  }
1826
- if (data.manifestName !== undefined && data.manifestName !== null) {
1522
+ if (data.manifestName != null) {
1827
1523
  contents.ManifestName = (0, smithy_client_1.expectString)(data.manifestName);
1828
1524
  }
1829
- if (data.mssPackage !== undefined && data.mssPackage !== null) {
1525
+ if (data.mssPackage != null) {
1830
1526
  contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
1831
1527
  }
1832
- if (data.origination !== undefined && data.origination !== null) {
1528
+ if (data.origination != null) {
1833
1529
  contents.Origination = (0, smithy_client_1.expectString)(data.origination);
1834
1530
  }
1835
- if (data.startoverWindowSeconds !== undefined && data.startoverWindowSeconds !== null) {
1531
+ if (data.startoverWindowSeconds != null) {
1836
1532
  contents.StartoverWindowSeconds = (0, smithy_client_1.expectInt32)(data.startoverWindowSeconds);
1837
1533
  }
1838
- if (data.tags !== undefined && data.tags !== null) {
1534
+ if (data.tags != null) {
1839
1535
  contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1840
1536
  }
1841
- if (data.timeDelaySeconds !== undefined && data.timeDelaySeconds !== null) {
1537
+ if (data.timeDelaySeconds != null) {
1842
1538
  contents.TimeDelaySeconds = (0, smithy_client_1.expectInt32)(data.timeDelaySeconds);
1843
1539
  }
1844
- if (data.url !== undefined && data.url !== null) {
1540
+ if (data.url != null) {
1845
1541
  contents.Url = (0, smithy_client_1.expectString)(data.url);
1846
1542
  }
1847
- if (data.whitelist !== undefined && data.whitelist !== null) {
1543
+ if (data.whitelist != null) {
1848
1544
  contents.Whitelist = deserializeAws_restJson1__listOf__string(data.whitelist, context);
1849
1545
  }
1850
- return Promise.resolve(contents);
1546
+ return contents;
1851
1547
  };
1852
1548
  exports.deserializeAws_restJson1UpdateOriginEndpointCommand = deserializeAws_restJson1UpdateOriginEndpointCommand;
1853
1549
  const deserializeAws_restJson1UpdateOriginEndpointCommandError = async (output, context) => {
@@ -1855,7 +1551,6 @@ const deserializeAws_restJson1UpdateOriginEndpointCommandError = async (output,
1855
1551
  ...output,
1856
1552
  body: await parseBody(output.body, context),
1857
1553
  };
1858
- let response;
1859
1554
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1860
1555
  switch (errorCode) {
1861
1556
  case "ForbiddenException":
@@ -1878,20 +1573,19 @@ const deserializeAws_restJson1UpdateOriginEndpointCommandError = async (output,
1878
1573
  throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1879
1574
  default:
1880
1575
  const parsedBody = parsedOutput.body;
1881
- const $metadata = deserializeMetadata(output);
1882
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1883
- response = new MediaPackageServiceException_1.MediaPackageServiceException({
1884
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1885
- $fault: "client",
1886
- $metadata,
1576
+ (0, smithy_client_1.throwDefaultError)({
1577
+ output,
1578
+ parsedBody,
1579
+ exceptionCtor: MediaPackageServiceException_1.MediaPackageServiceException,
1580
+ errorCode,
1887
1581
  });
1888
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1889
1582
  }
1890
1583
  };
1584
+ const map = smithy_client_1.map;
1891
1585
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1892
- const contents = {};
1586
+ const contents = map({});
1893
1587
  const data = parsedOutput.body;
1894
- if (data.message !== undefined && data.message !== null) {
1588
+ if (data.message != null) {
1895
1589
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1896
1590
  }
1897
1591
  const exception = new models_0_1.ForbiddenException({
@@ -1901,9 +1595,9 @@ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput,
1901
1595
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1902
1596
  };
1903
1597
  const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
1904
- const contents = {};
1598
+ const contents = map({});
1905
1599
  const data = parsedOutput.body;
1906
- if (data.message !== undefined && data.message !== null) {
1600
+ if (data.message != null) {
1907
1601
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1908
1602
  }
1909
1603
  const exception = new models_0_1.InternalServerErrorException({
@@ -1913,9 +1607,9 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (pars
1913
1607
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1914
1608
  };
1915
1609
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1916
- const contents = {};
1610
+ const contents = map({});
1917
1611
  const data = parsedOutput.body;
1918
- if (data.message !== undefined && data.message !== null) {
1612
+ if (data.message != null) {
1919
1613
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1920
1614
  }
1921
1615
  const exception = new models_0_1.NotFoundException({
@@ -1925,9 +1619,9 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
1925
1619
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1926
1620
  };
1927
1621
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
1928
- const contents = {};
1622
+ const contents = map({});
1929
1623
  const data = parsedOutput.body;
1930
- if (data.message !== undefined && data.message !== null) {
1624
+ if (data.message != null) {
1931
1625
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1932
1626
  }
1933
1627
  const exception = new models_0_1.ServiceUnavailableException({
@@ -1937,9 +1631,9 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
1937
1631
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1938
1632
  };
1939
1633
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1940
- const contents = {};
1634
+ const contents = map({});
1941
1635
  const data = parsedOutput.body;
1942
- if (data.message !== undefined && data.message !== null) {
1636
+ if (data.message != null) {
1943
1637
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1944
1638
  }
1945
1639
  const exception = new models_0_1.TooManyRequestsException({
@@ -1949,9 +1643,9 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
1949
1643
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1950
1644
  };
1951
1645
  const deserializeAws_restJson1UnprocessableEntityExceptionResponse = async (parsedOutput, context) => {
1952
- const contents = {};
1646
+ const contents = map({});
1953
1647
  const data = parsedOutput.body;
1954
- if (data.message !== undefined && data.message !== null) {
1648
+ if (data.message != null) {
1955
1649
  contents.Message = (0, smithy_client_1.expectString)(data.message);
1956
1650
  }
1957
1651
  const exception = new models_0_1.UnprocessableEntityException({
@@ -1964,9 +1658,6 @@ const serializeAws_restJson1__listOf__PeriodTriggersElement = (input, context) =
1964
1658
  return input
1965
1659
  .filter((e) => e != null)
1966
1660
  .map((entry) => {
1967
- if (entry === null) {
1968
- return null;
1969
- }
1970
1661
  return entry;
1971
1662
  });
1972
1663
  };
@@ -1974,9 +1665,6 @@ const serializeAws_restJson1__listOf__string = (input, context) => {
1974
1665
  return input
1975
1666
  .filter((e) => e != null)
1976
1667
  .map((entry) => {
1977
- if (entry === null) {
1978
- return null;
1979
- }
1980
1668
  return entry;
1981
1669
  });
1982
1670
  };
@@ -1984,9 +1672,6 @@ const serializeAws_restJson1__listOfHlsManifestCreateOrUpdateParameters = (input
1984
1672
  return input
1985
1673
  .filter((e) => e != null)
1986
1674
  .map((entry) => {
1987
- if (entry === null) {
1988
- return null;
1989
- }
1990
1675
  return serializeAws_restJson1HlsManifestCreateOrUpdateParameters(entry, context);
1991
1676
  });
1992
1677
  };
@@ -2005,9 +1690,6 @@ const serializeAws_restJson1AdTriggers = (input, context) => {
2005
1690
  return input
2006
1691
  .filter((e) => e != null)
2007
1692
  .map((entry) => {
2008
- if (entry === null) {
2009
- return null;
2010
- }
2011
1693
  return entry;
2012
1694
  });
2013
1695
  };